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

@import url('tokens.css');

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

body {
    background: var(--bg-void);
    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);
}

/* Ambient Background */
.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.7;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(180px);
    animation: float 25s ease-in-out infinite;
}

.orb-1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(77, 171, 154, 0.12) 0%, transparent 60%);
    top: -250px;
    right: -200px;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(91, 196, 176, 0.08) 0%, transparent 60%);
    bottom: -200px;
    left: -200px;
    animation-delay: -12s;
}

.orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(77, 171, 154, 0.06) 0%, transparent 60%);
    top: 40%;
    left: 20%;
    animation-delay: -6s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Grid Pattern */
.grid-pattern {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 70%);
}

/* Glass Card */
.login-card {
    background: rgba(10, 10, 12, 0.6);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-2xl);
    padding: 40px 40px;
    width: 100%;
    max-width: 460px;
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.02) inset,
        0 50px 100px -20px rgba(0, 0, 0, 0.6),
        0 30px 60px -30px rgba(0, 0, 0, 0.4);
    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: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(77, 171, 154, 0.6), transparent);
}

.login-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 50%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@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: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    line-height: 1.1;
    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: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 10;
}

/* Notion Button */
.notion-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    position: relative;
    z-index: 10;
    background: linear-gradient(135deg, #f0f0f2 0%, #ffffff 100%);
    color: #050507;
    box-shadow:
        0 4px 20px rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    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.4), transparent);
    transition: left 0.5s ease;
}

.notion-btn:hover {
    transform: translateY(-4px);
    box-shadow:
        0 20px 40px rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 0 60px rgba(77, 171, 154, 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: var(--accent-subtle);
    border: 1px solid rgba(77, 171, 154, 0.15);
    backdrop-filter: blur(10px);
}

.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.06), 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 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s var(--ease-out);
    white-space: nowrap;
}

.feature-item:hover {
    background: var(--accent-subtle);
    border-color: rgba(77, 171, 154, 0.15);
    transform: translateY(-2px);
}

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

.feature-item:hover .feature-icon {
    transform: scale(1.3) rotate(10deg);
}

.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: var(--radius-lg);
    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);
}

@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);
    }
}

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

    .login-heading {
        font-size: 38px;
    }
}
