:root {
    --tt-primary: #5b21ff;
    --tt-primary-dark: #3f16b8;
    --tt-accent: #a78bfa;
    --tt-black: #0f1118;
    --tt-light: #f4f5f8;
    --tt-muted: #e9eef5;
    --tt-text: #1a1d23;
    --tt-secondary-text: #6c757d;
}

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

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    min-width: 320px;
    background: var(--tt-black);
    color: var(--tt-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

.auth-page {
    position: relative;
    display: grid;
    min-height: 100vh;
    min-height: 100svh;
    place-items: center;
    overflow: hidden;
    padding: 28px;
    background: linear-gradient(135deg, var(--tt-black) 0%, #2b1f6e 55%, var(--tt-primary) 100%);
}

.auth-grid {
    position: absolute;
    inset: 0;
    opacity: 0.32;
    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: 56px 56px;
    mask-image: radial-gradient(circle at center, #000 0%, transparent 72%);
}

.auth-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(660px, 86vw);
    height: min(660px, 86vw);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    box-shadow: 0 0 120px rgba(91, 33, 255, 0.22), inset 0 0 100px rgba(167, 139, 250, 0.08);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    padding: 38px;
    border: 1px solid rgba(233, 238, 245, 0.9);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(15, 17, 24, 0.28), 0 2px 8px rgba(15, 17, 24, 0.08);
}

.platform-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 36px;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--tt-primary), var(--tt-accent));
    box-shadow: 0 8px 22px rgba(91, 33, 255, 0.3);
}

.brand-mark svg {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-copy {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: var(--tt-text);
    font-size: 15px;
    line-height: 1;
}

.brand-copy strong {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-copy span {
    color: #707684;
    font-weight: 700;
}

.card-heading {
    margin-bottom: 28px;
    text-align: center;
}

.card-heading h1 {
    margin: 0;
    color: var(--tt-text);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.flash-message {
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.flash-error {
    border-color: #f5c2c7;
    background: #f8d7da;
    color: #842029;
}

.flash-success {
    border-color: #badbcc;
    background: #d1e7dd;
    color: #0f5132;
}

.login-form {
    display: grid;
    gap: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-size: 12px;
    font-weight: 600;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    width: 100%;
    height: 52px;
    padding: 0 46px;
    border: 1px solid #dfe3e8;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--tt-text);
    font-size: 14px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-wrap input::placeholder {
    color: #a1a8b2;
}

.input-wrap input:hover {
    border-color: #c5cad1;
}

.input-wrap input:focus {
    border-color: var(--tt-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(91, 33, 255, 0.1);
}

.input-icon,
.password-toggle {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
}

.input-icon {
    left: 15px;
    color: #8b93a1;
    pointer-events: none;
}

.input-icon svg,
.password-toggle svg,
.session-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle {
    right: 8px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8b93a1;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: var(--tt-light);
    color: var(--tt-primary);
    outline: none;
}

.password-toggle .eye-closed {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
    display: block;
}

.submit-button {
    display: flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    padding: 0 22px;
    border: 1px solid var(--tt-primary);
    border-radius: 10px;
    background: var(--tt-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(91, 33, 255, 0.24);
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.submit-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 160ms ease;
}

.submit-button:hover,
.submit-button:focus-visible {
    border-color: var(--tt-primary-dark);
    background: var(--tt-primary-dark);
    box-shadow: 0 10px 26px rgba(91, 33, 255, 0.3);
    outline: none;
    transform: translateY(-1px);
}

.submit-button:hover svg {
    transform: translateX(3px);
}

.submit-button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.session-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    margin: 0 auto 24px;
    border-radius: 13px;
    background: rgba(91, 33, 255, 0.1);
    color: var(--tt-primary);
}

@media (max-width: 520px) {
    .auth-page {
        padding: 16px;
    }

    .login-card {
        padding: 30px 22px;
    }

    .platform-brand {
        margin-bottom: 32px;
    }

    .card-heading h1 {
        font-size: 25px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
