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

html, body {
    height: 100%;
    overflow: hidden;
    background: #040408;
}

/* ══════════════════════════════════════
   BACKGROUND TEXT
   ══════════════════════════════════════ */

.bg-text {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 18vw;
    text-transform: uppercase;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    padding: 0 2vw;
}

.letter {
    display: inline-block;
    color: rgba(255, 255, 255, 0.03);
    transform: translateY(110%);
}

.letter.wave-in {
    animation: waveUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes waveUp {
    0%   { transform: translateY(110%); }
    100% { transform: translateY(0); }
}

.bg-text.slide-up {
    transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1);
    transform: translateY(-15vh);
}

/* ══════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════ */

.content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 2.5em;
}

/* ══════════════════════════════════════
   TITLE – Letter wave
   ══════════════════════════════════════ */

.title {
    display: flex;
    align-items: baseline;
    gap: 0.3em;
    overflow: hidden;
    padding-bottom: 0.05em;
}

.title-word {
    display: inline-flex;
}

.title-letter {
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: clamp(1.6em, 6vw, 4.5em);
    color: #ffffff;
    letter-spacing: 0.02em;
    transform: translateY(105%);
    opacity: 0;
    will-change: transform, opacity;
}

.title-letter.wave-in {
    animation: titleWave 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes titleWave {
    0% {
        transform: translateY(105%);
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ══════════════════════════════════════
   LOGIN BOX
   ══════════════════════════════════════ */

.login-box {
    display: flex;
    flex-direction: column;
    gap: 1em;
    width: 100%;
    max-width: 360px;
    padding: 0 1.5em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.login-box.visible {
    opacity: 1;
    transform: translateY(0);
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.login-error {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: 0.85em;
    color: #ff6b81;
    text-align: center;
    background: rgba(255, 107, 129, 0.08);
    border: 1px solid rgba(255, 107, 129, 0.15);
    border-radius: 0.6em;
    padding: 0.7em 1em;
    animation: errorFadeIn 0.4s ease forwards;
}

.input-group {
    position: relative;
}

.input-error {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: 0.8em;
    color: #ff6b81;
    padding: 0.35em 0.3em 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.35s ease;
}

.input-error.visible {
    max-height: 2em;
    opacity: 1;
    padding: 0.45em 0.3em 0;
}

.login-input.has-error {
    border-color: rgba(255, 107, 129, 0.5);
    background: rgba(255, 107, 129, 0.04);
}

.login-input.has-error:focus {
    border-color: rgba(255, 107, 129, 0.6);
}

@keyframes errorFadeIn {
    0%   { opacity: 0; transform: translateY(-6px); }
    100% { opacity: 1; transform: translateY(0); }
}

.login-input {
    width: 100%;
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: 0.95em;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75em;
    padding: 1em 1.3em;
    outline: none;
    transition: border-color 0.3s, background 0.3s;
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-input:focus {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.07);
}

/* ══════════════════════════════════════
   LOGIN BUTTON
   ══════════════════════════════════════ */

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    width: 100%;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.95em;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.75em;
    padding: 0.9em 1.3em;
    cursor: pointer;
    margin-top: 0.4em;
    transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s ease;
}

.login-btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #000000;
    transform: translateY(-3px);
}

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

.login-btn-icon {
    display: flex;
    align-items: center;
    animation: arrowNudge 1.5s ease-in-out infinite;
}

@keyframes arrowNudge {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(4px); }
}

.login-btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ══════════════════════════════════════
   LOGIN HINT
   ══════════════════════════════════════ */

.login-hint {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: 0.82em;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    margin-top: 0.5em;
    line-height: 1.5;
}

.login-hint-link {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: opacity 0.25s;
    background: linear-gradient(135deg, #e44dd6, #9b59b6, #4338e0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.55);
}

.login-hint-link:hover {
    -webkit-text-fill-color: transparent;
}

/* ══════════════════════════════════════
   REGISTER PAGE
   ══════════════════════════════════════ */

.register-subtitle {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-bottom: 0.5em;
}

.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap .login-input {
    padding-right: 3em;
}

.pw-toggle {
    position: absolute;
    right: 0.8em;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.35);
    padding: 0.3em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.pw-toggle:hover {
    color: rgba(255, 255, 255, 0.7);
}

.register-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8em;
    text-align: center;
}

.success-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 1.3em;
    color: #ffffff;
}

/* ══════════════════════════════════════
   MOBILE — title in viewport, login larger
   ══════════════════════════════════════ */

@media (max-width: 768px) {
    .content {
        gap: 2em;
        padding: 0 1em;
        box-sizing: border-box;
    }

    .title {
        gap: 0.22em;
        max-width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .title-letter {
        font-size: clamp(1.6em, 8.5vw, 3em);
        letter-spacing: 0.01em;
    }

    .login-box {
        max-width: 400px;
        padding: 0 1em;
        gap: 1.1em;
    }

    .login-input {
        font-size: 1.05em;
        padding: 1.1em 1.3em;
        border-radius: 0.85em;
    }

    .login-btn {
        font-size: 1.05em;
        padding: 1.05em 1.3em;
        border-radius: 0.85em;
    }

    .login-btn-icon svg {
        width: 20px;
        height: 20px;
    }

    .login-hint {
        font-size: 0.9em;
    }
}

@media (max-width: 420px) {
    .title {
        gap: 0.18em;
    }
    .title-letter {
        font-size: clamp(1.4em, 9vw, 2.4em);
    }
}

.success-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.5);
}