@import url('../base/variables.css');

/* ── Shared auth layout (login, signup, forgot password) ── */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.auth-page {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--et-bg);
    color: var(--et-dark);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .auth-shell {
        grid-template-columns: 1fr 1fr;
    }
}

/* Brand panel */
.auth-brand {
    display: none;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    background: linear-gradient(145deg, var(--et-primary-dark) 0%, var(--et-primary) 55%, #6366f1 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

@media (min-width: 992px) {
    .auth-brand {
        display: flex;
    }
}

.auth-brand::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    top: -120px;
    right: -80px;
}

.auth-brand::after {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    bottom: -60px;
    left: -40px;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
    margin-bottom: 2.5rem;
}

.auth-logo i {
    font-size: 1.35rem;
}

.auth-brand h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0 0 0.75rem;
}

.auth-brand > .auth-brand-inner > p,
.auth-brand-tagline {
    font-size: 1rem;
    opacity: 0.88;
    line-height: 1.6;
    margin: 0 0 2rem;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.9rem;
    opacity: 0.92;
}

.auth-features i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--et-radius-sm);
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Form panel */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    box-shadow: var(--et-card-shadow);
    padding: 2rem 1.75rem;
}

.auth-page--signup .auth-card {
    max-width: 560px;
}

.auth-mobile-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--et-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
    .auth-mobile-logo {
        display: none;
    }
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.35rem;
    color: var(--et-dark);
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--et-muted);
    margin: 0 0 1.75rem;
}

/* Form fields */
.auth-field {
    margin-bottom: 1.1rem;
}

.auth-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--et-dark);
    margin-bottom: 0.4rem;
}

.auth-input {
    display: block;
    width: 100%;
    padding: 0.7rem 0.85rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--et-dark);
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-sm);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:focus {
    border-color: var(--et-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.auth-input::placeholder {
    color: #9ca3af;
}

.auth-input-group {
    display: flex;
    gap: 0.5rem;
}

.auth-input-group .auth-input {
    flex: 1;
    min-width: 0;
}

.auth-password-wrap {
    position: relative;
}

.auth-password-wrap .auth-input {
    padding-right: 2.75rem;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--et-muted);
    font-size: 1rem;
    line-height: 1;
}

.auth-password-toggle:hover {
    color: var(--et-primary);
}

/* Grid for signup */
.auth-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 1rem;
}

@media (min-width: 540px) {
    .auth-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .auth-form-grid .auth-field--full {
        grid-column: 1 / -1;
    }
}

/* Gender radios */
.auth-radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-radio {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--et-dark);
}

.auth-radio input {
    accent-color: var(--et-primary);
    width: 16px;
    height: 16px;
}

/* Buttons */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--et-radius-sm);
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.auth-btn--primary {
    background: var(--et-primary);
    color: #fff;
}

.auth-btn--primary:hover {
    background: var(--et-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.auth-btn--outline {
    background: var(--et-surface);
    color: var(--et-primary);
    border: 1px solid var(--et-border);
    white-space: nowrap;
    width: auto;
    flex-shrink: 0;
}

.auth-btn--outline:hover {
    background: var(--et-primary-soft);
    border-color: var(--et-primary);
}

.auth-btn.is-loading,
.auth-btn:disabled {
    opacity: 0.85;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.et-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: et-spin 0.65s linear infinite;
}

.et-btn-loading-text {
    line-height: 1;
}

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

.auth-btn--ghost {
    background: transparent;
    color: var(--et-muted);
    border: 1px solid var(--et-border);
    margin-top: 0.65rem;
}

.auth-btn--ghost:hover {
    background: var(--et-bg);
    color: var(--et-dark);
}

/* Messages */
.auth-error,
.auth-msg {
    font-size: 0.8125rem;
    margin-top: 0.35rem;
    display: none;
}

.auth-error {
    color: var(--et-danger);
}

.auth-msg.text-danger {
    color: var(--et-danger);
}

.auth-msg.text-success {
    color: var(--et-accent);
}

.auth-error.show,
.auth-msg.show {
    display: block;
}

.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--et-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: none;
}

.auth-alert.show,
.auth-alert:not(.d-none) {
    display: block;
}

.auth-alert--success {
    background: var(--et-accent-soft);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.auth-alert--danger {
    background: #fef2f2;
    color: var(--et-danger);
    border: 1px solid #fecaca;
}

/* Footer links */
.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.8125rem;
}

.auth-links a {
    color: var(--et-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-footer-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--et-muted);
}

.auth-footer-text a {
    color: var(--et-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

.auth-divider {
    height: 1px;
    background: var(--et-border);
    margin: 1.25rem 0;
}

.auth-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-field--actions {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

@media (max-width: 991px) {
    .auth-card {
        padding: 1.75rem 1.25rem;
    }
}

@media (max-width: 539px) {
    .auth-input-group {
        flex-direction: column;
    }

    .auth-btn--outline {
        width: 100%;
    }
}
