/* ============================================================
   auth.css — Login / Register / Forgot-password page styles
   Depends on: index.css (CSS variables, header, footer, reset)
============================================================ */

/* -------------------------------------------------------
   1. PAGE LAYOUT
------------------------------------------------------- */
.auth-body {
    /* Ensure the footer stays at the bottom on short content */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 80px;
    position: relative;
    background: #fafafa;
    overflow: hidden;
}

/* -------------------------------------------------------
   2. BACKGROUND DECORATIONS
------------------------------------------------------- */
.auth-bg-dot-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(#b0bec5 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.38;
    mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, black 0%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, black 0%, transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.auth-bg-glow {
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(66, 133, 244, 0.1) 0%, transparent 65%);
    filter: blur(50px);
    pointer-events: none;
    z-index: 0;
}

/* -------------------------------------------------------
   3. AUTH CARD
------------------------------------------------------- */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 40px 40px 36px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 8px 32px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.02);
}

/* -------------------------------------------------------
   4. BRAND
------------------------------------------------------- */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 28px;
    text-decoration: none;
    color: var(--text-main);
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.4px;
}

.auth-brand svg {
    width: 24px;
    height: 24px;
    color: var(--accent-blue);
    flex-shrink: 0;
}

/* -------------------------------------------------------
   5. TABS
------------------------------------------------------- */
.auth-tabs {
    display: flex;
    gap: 0;
    background: var(--surface-gray);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 28px;
}

.auth-tab {
    flex: 1;
    padding: 9px 0;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.auth-tab.active {
    background: #ffffff;
    color: var(--text-main);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.auth-tab:hover:not(.active) {
    color: var(--text-main);
}

/* -------------------------------------------------------
   6. PANELS
------------------------------------------------------- */
.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

.auth-sub {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.55;
}

/* -------------------------------------------------------
   7. FORM FIELDS
------------------------------------------------------- */
.form-field {
    margin-bottom: 16px;
}

.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 6px;
}

.label-optional {
    color: var(--text-tertiary);
    font-weight: 400;
}

.form-field input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14.5px;
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-field input::placeholder {
    color: #c2c7cf;
}

.form-field input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.12);
}

.form-field input.input-error {
    border-color: #e53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

/* Password field with toggle */
.input-with-toggle {
    position: relative;
}

.input-with-toggle input {
    padding-right: 44px;
}

.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.pw-toggle:hover {
    color: var(--text-main);
}

.pw-toggle svg {
    width: 17px;
    height: 17px;
}

/* Email code input with send button */
.input-with-action {
    display: flex;
    gap: 8px;
}

.input-with-action input {
    flex: 1;
    min-width: 0;
}

.btn-send-code {
    flex-shrink: 0;
    height: 42px;
    padding: 0 14px;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    background: var(--surface-gray);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.btn-send-code:hover:not(:disabled) {
    background: #eeeeee;
    border-color: #d0d5dd;
}

.btn-send-code:disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

.btn-send-code.counting {
    color: var(--text-tertiary);
}

/* Forgot password link row */
.form-footer-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -8px;
    margin-bottom: 14px;
}

/* -------------------------------------------------------
   8. ALERT
------------------------------------------------------- */
.form-alert {
    display: none;
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 14px;
}

.form-alert.is-error {
    display: block;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
}

.form-alert.is-success {
    display: block;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #276749;
}

/* -------------------------------------------------------
   9. SUBMIT BUTTON
------------------------------------------------------- */
.btn-auth {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 11px;
    background: var(--text-main);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.18s, transform 0.12s;
    position: relative;
    overflow: hidden;
}

.btn-auth:hover:not(:disabled) {
    background: #222222;
}

.btn-auth:active:not(:disabled) {
    transform: scale(0.985);
}

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.btn-auth.is-loading .btn-spinner {
    display: block;
}

.btn-auth.is-loading .btn-label {
    opacity: 0.75;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* -------------------------------------------------------
   10. UTILITY LINKS & SWITCH
------------------------------------------------------- */
.link-btn {
    border: none;
    background: none;
    padding: 0;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-blue);
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s;
}

.link-btn:hover {
    opacity: 0.75;
    text-decoration: underline;
}

.auth-switch {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-tos {
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.auth-tos a {
    color: var(--text-secondary);
    text-decoration: underline;
}

/* -------------------------------------------------------
   11. SUCCESS PANEL
------------------------------------------------------- */
.auth-success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f0fff4;
    border: 2px solid #c6f6d5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px auto 20px;
    color: #38a169;
}

.auth-success-icon svg {
    width: 28px;
    height: 28px;
}

.auth-success-title {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.auth-success-desc {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.55;
}

/* -------------------------------------------------------
   12. RESPONSIVE
------------------------------------------------------- */
@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px 28px;
        border-radius: 16px;
    }

    .auth-main {
        padding: 100px 16px 60px;
    }

    .btn-send-code {
        height: 40px;
    }
}
