/*
 * Auth pages (login, callback) — standalone entry, not loaded via main.css.
 * Imports the tokens layer directly so it stays decoupled from the app shell.
 */

@import url('tokens/_index.css');
@import url('base/reset.css');
@import url('utilities/state.css');

body {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: var(--sp-6);
    overflow-x: hidden;
    background: var(--surface-inverse);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

/* ── Floating bubbles background (auth-only) ─────────────────────────── */
.bg-bubbles {
    position: fixed;
    inset: 0;
    z-index: var(--z-particles);
    overflow: hidden;
    pointer-events: none;
}

.bg-bubbles span {
    position: absolute;
    bottom: -60px;
    display: block;
    color: rgba(183, 196, 11, 0.12);
    font-family: var(--font-sans);
    font-weight: var(--fw-700);
    user-select: none;
    animation: bubble-rise linear infinite;
}

@keyframes bubble-rise {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

.bg-bubbles span:nth-child(1)  { left: 5%;  font-size: 36px; animation-delay: 0s; animation-duration: 10s; }
.bg-bubbles span:nth-child(2)  { left: 15%; font-size: 56px; animation-delay: 1s; animation-duration: 13s; }
.bg-bubbles span:nth-child(3)  { left: 25%; font-size: 28px; animation-delay: 3s; animation-duration: 11s; }
.bg-bubbles span:nth-child(4)  { left: 35%; font-size: 48px; animation-delay: 0s; animation-duration: 9s;  }
.bg-bubbles span:nth-child(5)  { left: 45%; font-size: 32px; animation-delay: 2s; animation-duration: 12s; }
.bg-bubbles span:nth-child(6)  { left: 55%; font-size: 52px; animation-delay: 4s; animation-duration: 14s; }
.bg-bubbles span:nth-child(7)  { left: 65%; font-size: 40px; animation-delay: 6s; animation-duration: 10s; }
.bg-bubbles span:nth-child(8)  { left: 75%; font-size: 30px; animation-delay: 3s; animation-duration: 11s; }
.bg-bubbles span:nth-child(9)  { left: 85%; font-size: 44px; animation-delay: 5s; animation-duration: 15s; }
.bg-bubbles span:nth-child(10) { left: 92%; font-size: 34px; animation-delay: 1s; animation-duration: 9s;  }
.bg-bubbles span:nth-child(11) { left: 20%; font-size: 24px; animation-delay: 0s; animation-duration: 12s; }
.bg-bubbles span:nth-child(12) { left: 48%; font-size: 38px; animation-delay: 2s; animation-duration: 10s; }
.bg-bubbles span:nth-child(13) { left: 60%; font-size: 30px; animation-delay: 7s; animation-duration: 13s; }
.bg-bubbles span:nth-child(14) { left: 8%;  font-size: 50px; animation-delay: 4s; animation-duration: 11s; }
.bg-bubbles span:nth-child(15) { left: 78%; font-size: 26px; animation-delay: 1s; animation-duration: 8s;  }

/* ── Containers ──────────────────────────────────────────────────────── */
.login-container,
.callback-container {
    position: relative;
    z-index: var(--z-content);
    width: 100%;
    max-width: 440px;
    padding: var(--sp-12) var(--sp-10);
    background: var(--surface-0);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--white-alpha-5);
    text-align: center;
}

.logo {
    width: 180px;
    margin: 0 auto var(--sp-8);
}

h1 {
    margin-bottom: var(--sp-1);
    color: var(--text-primary);
    font-size: var(--fs-3xl);
    font-weight: var(--fw-700);
    letter-spacing: var(--tracking-tighter);
}

.subtitle {
    margin-bottom: var(--sp-8);
    color: var(--text-tertiary);
    font-size: var(--fs-md);
    font-weight: var(--fw-400);
}

/* ── Google OAuth button ─────────────────────────────────────────────── */
.google-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--sp-3);
    width: 100%;
    padding: 14px var(--sp-6);
    background: var(--surface-0);
    border: 1.5px solid var(--surface-3);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--fs-md);
    font-weight: var(--fw-600);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--duration-slow) var(--ease-out);
}

.google-btn:hover {
    background: var(--brand-glow);
    border-color: var(--brand);
    box-shadow: 0 4px 12px rgba(183, 196, 11, 0.2);
    transform: translateY(-1px);
}

.google-btn:active {
    transform: translateY(0);
}

.google-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* ── Messages, divider, info ─────────────────────────────────────────── */
.error-message {
    margin-bottom: var(--sp-5);
    padding: 14px var(--sp-4);
    background: var(--surface-1);
    border-left: 3px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--fs-base);
    line-height: var(--leading-normal);
    text-align: left;
}

.info-text {
    margin-top: var(--sp-6);
    color: var(--text-tertiary);
    font-size: var(--fs-base);
    line-height: var(--leading-relaxed);
}

.info-text strong {
    color: var(--brand);
    font-weight: var(--fw-700);
}

.divider {
    height: 1px;
    margin: 28px 0;
    background: var(--surface-3);
}

/* ── Feature list ────────────────────────────────────────────────────── */
.feature-list {
    padding: var(--sp-5);
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-align: left;
}

.feature-list h3 {
    margin-bottom: var(--sp-3);
    color: var(--text-tertiary);
    font-size: var(--fs-xs);
    font-weight: var(--fw-700);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
}

.feature-list ul { list-style: none; }

.feature-list li {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 6px 0;
    color: var(--text-secondary);
    font-size: var(--fs-base);
    line-height: var(--leading-normal);
}

.feature-list li::before {
    content: '';
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    background: var(--brand);
    border-radius: var(--radius-full);
}

/* ── Spinner & retry ─────────────────────────────────────────────────── */
.spinner {
    position: relative;
    width: 48px;
    height: 48px;
    margin: 0 auto var(--sp-5);
    color: var(--brand);
    border-radius: 50%;
    transform: rotateZ(45deg);
    perspective: 1000px;
}

.spinner::before,
.spinner::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: inherit;
    height: inherit;
    border-radius: 50%;
    transform: rotateX(70deg);
    animation: spinner-arm 1s linear infinite;
}

.spinner::after {
    color: var(--brand);
    transform: rotateY(70deg);
    animation-delay: 0.4s;
}

@keyframes spinner-arm {
    0%, 100% { box-shadow: 0.2em 0 0 0 currentcolor; }
    12%      { box-shadow: 0.2em 0.2em 0 0 currentcolor; }
    25%      { box-shadow: 0 0.2em 0 0 currentcolor; }
    37%      { box-shadow: -0.2em 0.2em 0 0 currentcolor; }
    50%      { box-shadow: -0.2em 0 0 0 currentcolor; }
    62%      { box-shadow: -0.2em -0.2em 0 0 currentcolor; }
    75%      { box-shadow: 0 -0.2em 0 0 currentcolor; }
    87%      { box-shadow: 0.2em -0.2em 0 0 currentcolor; }
}

.retry-btn {
    display: inline-block;
    margin-top: var(--sp-3);
    padding: var(--sp-3) var(--sp-5);
    background: var(--brand);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-on-brand);
    font-family: inherit;
    font-size: var(--fs-base);
    font-weight: var(--fw-600);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--duration-slow) var(--ease-out);
}

.retry-btn:hover {
    background: var(--brand-dark);
    box-shadow: var(--shadow-brand);
}

/* ── Language switcher ───────────────────────────────────────────────── */
.login-lang-switcher {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
}

.lang-flag-btn-login {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 30px;
    padding: 2px;
    overflow: hidden;
    background: none;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    line-height: 1;
    cursor: pointer;
    transition: all var(--duration-slow) var(--ease-out);
}

.lang-flag-btn-login svg {
    border-radius: 2px;
    box-shadow: 0 0 0 1px var(--black-alpha-10);
}

.lang-flag-btn-login:hover {
    background: var(--surface-1);
    border-color: var(--brand);
    transform: scale(1.15);
}

@media (max-width: 480px) {
    .login-container,
    .callback-container {
        padding: 36px 28px;
    }

    h1 { font-size: var(--fs-2xl); }
    .logo { width: 150px; }
}
