/* ============================================
   TSB 5.0 - Login Page Styles
   Tokens imported via tokens.css
   ============================================ */

@import url('tokens.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-secondary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

html.dark {
    background: #0b0b0c;
}

/* Ambient glow & grid-pattern now unified in app-brand.css */

/* Glass Card */
.login-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.01) 0%, rgba(255, 255, 255, 0.01) 16%, rgba(255, 255, 255, 0) 34%),
        linear-gradient(180deg, rgba(23, 24, 24, 0.56) 0%, rgba(16, 18, 18, 0) 100%);
    backdrop-filter: blur(24px) saturate(145%);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 34px 32px 30px;
    width: 100%;
    max-width: 430px;
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(255, 255, 255, 0.04),
        0 10px 30px rgba(0, 0, 0, 0.1);
    animation: cardEnter 1s var(--ease-out) forwards;
    opacity: 0;
    transform: translateY(40px) scale(0.98);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 34%, transparent 72%);
}

@keyframes cardEnter {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
    animation: logoEnter 0.8s var(--ease-spring) 0.2s forwards;
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
}

@keyframes logoEnter {
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.logo-box {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    box-shadow:
        0 10px 40px var(--accent-glow),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    font-family: 'DM Mono', monospace;
    color: #050507;
    font-weight: 700;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    position: relative;
}

.logo-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
}

/* Heading */
.login-heading {
    font-size: clamp(2rem, 2.8vw, 2.6rem);
    font-weight: 620;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.055em;
    line-height: 0.96;
    position: relative;
    z-index: 10;
}

.accent-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 50%, var(--accent) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

/* Subheading */
.login-sub {
    color: rgba(214, 223, 232, 0.58);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.68;
    margin-bottom: 30px;
    max-width: 330px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 10;
}

.verify-step-copy {
    color: rgba(214, 223, 232, 0.58);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.verify-code-input {
    width: 100%;
    min-height: 56px;
    border-radius: 20px;
    border: none !important;
    text-align: center;
    letter-spacing: 0.32em;
    font-size: 28px !important;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.03) !important;
    color: var(--text-primary) !important;
}

.verify-step-note {
    color: rgba(214, 223, 232, 0.42);
    font-size: 13px;
    margin-top: 12px;
}

/* Notion Button */
.notion-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.02),
        0 10px 26px rgba(0, 0, 0, 0.12);
    transition: all 0.4s var(--ease-out);
    overflow: hidden;
}

.notion-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent);
    transition: left 0.5s ease;
}

.notion-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.042);
    border-color: rgba(255, 255, 255, 0.11);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.02),
        0 14px 30px rgba(0, 0, 0, 0.15);
}

.notion-btn:hover::before {
    left: 100%;
}

.notion-btn:active {
    transform: translateY(-2px);
}

.notion-logo {
    transition: transform 0.4s var(--ease-spring);
}

.notion-btn:hover .notion-logo {
    transform: rotate(12deg) scale(1.1);
}

/* Stats Badge */
.stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    margin-top: var(--space-8);
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.022);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-badge .count {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}

.stats-badge .dot {
    color: #3a3a42;
}

.stats-badge .label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Divider */
.divider {
    height: 1px;
    margin: var(--space-8) 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

/* Feature Items */
.features-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    position: relative;
    z-index: 10;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s var(--ease-out);
    white-space: nowrap;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.feature-icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
    transition: all 0.4s var(--ease-spring);
}

.feature-item:hover .feature-icon {
    transform: none;
}

.feature-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Terms */
.login-terms {
    margin-top: var(--space-8);
    font-size: 13px;
    color: #3a3a42;
    position: relative;
    z-index: 10;
}

.login-terms a {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    decoration-color: #3a3a42;
    transition: color var(--duration-normal);
}

.login-terms a:hover {
    color: var(--accent);
}

/* Alert Messages */
.login-alert {
    margin-bottom: var(--space-8);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 10;
    animation: alertSlide 0.6s var(--ease-spring) forwards;
}

.login-alert.success {
    background: var(--green-bg);
    border: 1px solid var(--green-border);
}

.login-alert.error {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
}

.login-alert .alert-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-alert.success .alert-icon {
    background: rgba(34, 197, 94, 0.12);
    color: var(--green-light);
}

.login-alert.error .alert-icon {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red-light);
}

.login-alert .alert-icon i {
    width: 20px;
    height: 20px;
}

.login-alert .alert-content {
    text-align: left;
}

.login-alert.success .alert-title {
    color: var(--green-light);
    font-weight: 600;
    font-size: 14px;
}

.login-alert.success .alert-text {
    font-size: 12px;
    color: rgba(74, 222, 128, 0.6);
}

.login-alert.error .alert-title {
    color: var(--red-light);
    font-weight: 600;
    font-size: 14px;
}

.login-alert.error .alert-text {
    font-size: 12px;
    color: rgba(248, 113, 113, 0.6);
}

.login-helper {
    margin-bottom: var(--space-8);
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(77, 171, 154, 0.18);
    background: linear-gradient(180deg, rgba(77, 171, 154, 0.08), rgba(77, 171, 154, 0.04));
    text-align: left;
    position: relative;
    z-index: 10;
}

.login-helper-kicker {
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(159, 230, 216, 0.92);
}

.login-helper p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(214, 223, 232, 0.76);
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Stagger Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s var(--ease-out) forwards;
}

.fade-up-1 { animation-delay: 0.3s; }
.fade-up-2 { animation-delay: 0.45s; }
.fade-up-3 { animation-delay: 0.6s; }
.fade-up-4 { animation-delay: 0.75s; }
.fade-up-5 { animation-delay: 0.9s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Auth Forms (shared: login, forgot-password)
   ============================================ */
.auth-form { position: relative; z-index: 10; text-align: left; }
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}
.auth-form input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(77, 171, 154, 0.1);
}
.auth-form input::placeholder { color: #3a3a42; }

.auth-submit {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-lg);
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    color: #050507;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--accent-glow);
}
.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-error {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red-light);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}
.auth-error.visible { display: block; }

.auth-success {
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    color: var(--green);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}
.auth-success.visible { display: block; }

.or-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    position: relative;
    z-index: 10;
}
.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}
.or-divider span {
    font-size: 12px;
    color: #3a3a42;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    position: relative;
    z-index: 10;
}
.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
}
.auth-switch a:hover { opacity: 0.8; }

.forgot-link {
    display: block;
    text-align: right;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    margin-top: -8px;
    margin-bottom: 16px;
    position: relative;
    z-index: 10;
}
.forgot-link:hover { color: var(--accent); }

.notion-btn-small {
    padding: 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.notion-btn-small:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* OTP code input (forgot-password) */
.code-input {
    text-align: center;
    letter-spacing: 8px;
    font-size: 24px !important;
    font-weight: 700;
}

/* Responsive */
@media (min-width: 768px) {
    .login-card {
        padding: 38px 36px 32px;
    }

    .login-heading {
        font-size: clamp(2.1rem, 2.5vw, 2.8rem);
    }
}
