/**
 * Auth Pages - Minimal Apple-Style Design
 */

/* ==================== Base & Reset ==================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #ffffff;
    color: #1d1d1f;
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
}

/* ==================== Auth Container ==================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-wrapper {
    width: 100%;
    max-width: 340px;
}

.auth-card {
    width: 100%;
}

/* ==================== Header ==================== */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #1d1d1f 0%, #424245 100%);
    border-radius: 14px;
    margin-bottom: 24px;
    text-decoration: none;
}

.auth-logo i {
    font-size: 1.5rem;
    color: #ffffff;
}

.auth-logo span {
    display: none;
}

.auth-title {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 8px 0;
    line-height: 1.14286;
    letter-spacing: 0.007em;
}

.auth-subtitle {
    font-size: 17px;
    color: #86868b;
    margin: 0;
    font-weight: 400;
    line-height: 1.47059;
}

/* ==================== Form Elements ==================== */
.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #86868b;
    margin-bottom: 6px;
    padding-left: 2px;
}

.form-label .optional {
    font-weight: 400;
    color: #86868b;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    font-size: 17px;
    color: #1d1d1f;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.form-input::placeholder {
    color: #86868b;
}

.form-input.error {
    border-color: #ff3b30;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    background: #0071e3;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0077ed;
}

.btn-primary:active:not(:disabled) {
    background: #006edb;
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: #d2d2d7;
    color: #86868b;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: #0071e3;
    border: none;
}

.btn-secondary:hover {
    color: #0077ed;
}

/* ==================== Loading Spinner ==================== */
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Social Buttons ==================== */
.divider {
    margin: 28px 0;
    position: relative;
    text-align: center;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #d2d2d7;
}

.divider-text {
    position: relative;
    background: #ffffff;
    padding: 0 16px;
    font-size: 13px;
    color: #86868b;
    font-weight: 400;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-btn {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    background: #ffffff;
    color: #1d1d1f;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-btn:hover {
    background: #f5f5f7;
}

.social-btn:active {
    background: #e8e8ed;
    transform: scale(0.98);
}

.social-btn i {
    font-size: 18px;
}

.social-btn.google-btn:hover {
    border-color: #1d1d1f;
}

.social-btn.twitter-btn:hover {
    border-color: #1d1d1f;
}

/* ==================== Footer Links ==================== */
.auth-footer {
    text-align: center;
}

.auth-links {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid #d2d2d7;
}

.auth-links p {
    margin: 10px 0;
    font-size: 14px;
    color: #86868b;
}

.link {
    color: #0071e3;
    text-decoration: none;
    font-weight: 400;
}

.link:hover {
    text-decoration: underline;
}

.link.premium-link {
    color: #0071e3;
    font-weight: 500;
}

.link.premium-link:hover {
    text-decoration: underline;
}

.forgot-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

/* ==================== Alerts & Messages ==================== */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-error {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

.alert i {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.validation-errors {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.validation-errors ul {
    margin: 0;
    padding-left: 20px;
}

.hidden {
    display: none !important;
}

/* ==================== Loading State ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.loading-content {
    text-align: center;
}

.loading-spinner-large {
    width: 40px;
    height: 40px;
    border: 3px solid #d2d2d7;
    border-top-color: #0071e3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.loading-text {
    color: #86868b;
    font-size: 14px;
}

/* ==================== Responsive ==================== */
@media (max-width: 640px) {
    .auth-container {
        padding: 16px;
        align-items: flex-start;
        padding-top: 60px;
    }

    .auth-wrapper {
        max-width: 100%;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-subtitle {
        font-size: 15px;
    }

    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .btn {
        font-size: 17px;
    }

    .social-btn {
        font-size: 16px;
    }
}

/* ==================== Password Strength ==================== */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 3px;
    background: #d2d2d7;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.strength-fill.weak {
    width: 33%;
    background: #ff3b30;
}

.strength-fill.medium {
    width: 66%;
    background: #ff9500;
}

.strength-fill.strong {
    width: 100%;
    background: #34c759;
}

.strength-text {
    font-size: 12px;
    color: #86868b;
}

/* ==================== Extension Banner ==================== */
.extension-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f5f5f7;
    border-radius: 12px;
    margin-bottom: 24px;
}

.extension-banner .extension-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0071e3 0%, #00a2ff 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
}

.extension-banner .extension-text {
    flex: 1;
}

.extension-banner .extension-title {
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    margin: 0 0 2px;
}

.extension-banner .extension-subtitle {
    font-size: 12px;
    color: #0071e3;
    margin: 0;
}
