/* ============================================================================
   TrackMyTickets — Auth pages (org + platform login)
   ============================================================================ */

:root {
    --auth-primary: #6366f1;
    --auth-primary-dark: #4f46e5;
    --auth-secondary: #8b5cf6;
    --auth-accent: #a855f7;
    --auth-text: #0f172a;
    --auth-text-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-input-bg: #f8fafc;
    --auth-radius: 12px;
    --auth-radius-lg: 16px;
    --auth-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --auth-shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --auth-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --auth-hero-bg: linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #312e81 100%);
    --auth-font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

.auth-page--platform {
    --auth-primary: #334155;
    --auth-primary-dark: #1e293b;
    --auth-secondary: #475569;
    --auth-accent: #0ea5e9;
    --auth-gradient: linear-gradient(135deg, #1e293b 0%, #334155 50%, #0f172a 100%);
    --auth-hero-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0c4a6e 100%);
}

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

html {
    scroll-behavior: smooth;
}

.auth-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--auth-text);
    min-height: 100vh;
    margin: 0;
    background: #fff;
}

.auth-page h1,
.auth-page h2,
.auth-page .auth-welcome {
    font-family: var(--auth-font-display);
}

.auth-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ── Hero panel ─────────────────────────────────────────────────────────── */
.auth-hero {
    flex: 1.15;
    background: var(--auth-hero-bg);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    overflow: hidden;
    color: #fff;
}

.auth-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black, transparent);
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    animation: authBlobFloat 12s ease-in-out infinite;
}

.auth-blob-1 {
    width: 320px;
    height: 320px;
    background: var(--auth-primary);
    top: 10%;
    left: 5%;
}

.auth-blob-2 {
    width: 280px;
    height: 280px;
    background: var(--auth-accent);
    bottom: 15%;
    right: 10%;
    animation-delay: -4s;
}

@keyframes authBlobFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -15px); }
}

.auth-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 440px;
    text-align: center;
    animation: authFadeUp 0.7s ease both;
}

@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-hero-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    backdrop-filter: blur(12px);
}

.auth-hero-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.auth-hero-subtitle {
    font-size: 1.05rem;
    opacity: 0.88;
    line-height: 1.65;
    margin: 0;
    font-weight: 400;
}

.auth-hero-features {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    text-align: left;
}

.auth-hero-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    opacity: 0.92;
}

.auth-hero-feature i {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

/* ── Form panel ─────────────────────────────────────────────────────────── */
.auth-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #fff;
    position: relative;
}

.auth-panel-top {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    right: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--auth-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.auth-back-link:hover {
    color: var(--auth-primary);
    background: var(--auth-input-bg);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    animation: authFadeUp 0.6s ease 0.1s both;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.auth-brand img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.auth-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.auth-brand-name {
    font-family: var(--auth-font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--auth-text);
    line-height: 1.2;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    width: fit-content;
}

.auth-badge--org {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12));
    color: var(--auth-primary-dark);
}

.auth-badge--platform {
    background: #f1f5f9;
    color: #475569;
}

.auth-welcome {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
    color: var(--auth-text);
}

.auth-subtitle {
    color: var(--auth-text-muted);
    font-size: 0.95rem;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.auth-org-chip {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border: 1px solid #c7d2fe;
    border-radius: var(--auth-radius);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: #4338ca;
}

.auth-org-chip i {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.auth-org-chip strong {
    display: block;
    color: #312e81;
    margin-bottom: 0.15rem;
}

.auth-org-chip code {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    word-break: break-all;
}

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.auth-alert {
    display: none;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: var(--auth-radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.45;
}

.auth-alert.is-visible {
    display: flex;
    animation: authFadeUp 0.35s ease;
}

.auth-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.auth-alert--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.auth-alert i {
    margin-top: 0.1rem;
    flex-shrink: 0;
}

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

.auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 0.4rem;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s;
}

.auth-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.65rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input::placeholder {
    color: #94a3b8;
}

.auth-input:hover {
    border-color: #cbd5e1;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.auth-page--platform .auth-input:focus {
    box-shadow: 0 0 0 4px rgba(51, 65, 85, 0.12);
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--auth-primary);
}

.auth-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

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

.auth-toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
}

.auth-toggle-password:hover {
    color: var(--auth-primary);
    background: rgba(99, 102, 241, 0.08);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 0.5rem;
}

.auth-link {
    color: var(--auth-primary);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    padding: 0.9rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--auth-gradient);
    border: none;
    border-radius: var(--auth-radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    position: relative;
    overflow: hidden;
}

.auth-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.auth-submit:hover:not(:disabled)::before {
    transform: translateX(100%);
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.auth-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

.auth-page--platform .auth-submit {
    box-shadow: 0 4px 14px rgba(30, 41, 59, 0.3);
}

.auth-spinner {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.7s linear infinite;
}

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

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

.auth-footer p {
    margin: 0.35rem 0;
}

.auth-footer a {
    color: var(--auth-text-muted);
    text-decoration: none;
    margin: 0 0.35rem;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: var(--auth-primary);
}

.auth-help {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--auth-border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--auth-text-muted);
}

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

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

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .auth-hero {
        display: none;
    }

    .auth-panel {
        background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 100%);
        min-height: 100vh;
        padding: 1.25rem;
    }

    .auth-page--platform .auth-panel {
        background: linear-gradient(160deg, #f1f5f9 0%, #e2e8f0 100%);
    }

    .auth-card {
        background: #fff;
        padding: 1.75rem;
        border-radius: var(--auth-radius-lg);
        box-shadow: var(--auth-shadow-lg);
    }
}

@media (max-width: 420px) {
    .auth-welcome {
        font-size: 1.5rem;
    }

    .auth-panel-top {
        position: static;
        margin-bottom: 1rem;
        width: 100%;
        max-width: 420px;
    }
}

.auth-trust-banner {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--auth-radius);
    font-size: 0.8rem;
    color: #0c4a6e;
    line-height: 1.45;
}

.auth-trust-banner i {
    color: #0284c7;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.auth-trust-banner strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #0f172a;
}

.auth-trust-banner code {
    font-size: 0.75rem;
    background: #e0f2fe;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.auth-trust-note {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: #64748b;
}

.auth-trust-banner--platform {
    background: #f8fafc;
    border-color: var(--auth-border);
    color: var(--auth-text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .auth-blob,
    .auth-hero-inner,
    .auth-card,
    .auth-alert.is-visible {
        animation: none;
    }
}
