:root {
    --auth-line: rgba(255, 255, 255, 0.14);
    --auth-text: #edf2fb;
    --auth-muted: #a9b2c2;
    --auth-gold: #efc64f;
    --auth-gold-deep: #b98a23;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
}

.auth-body {
    color: var(--auth-text);
    font-family: "Manrope", sans-serif;
    background: #070b14;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-body.terms-modal-open {
    overflow: hidden;
}

.auth-topbar {
    position: relative;
    z-index: 5;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-gold);
    text-decoration: none;
    font-family: "Unbounded", sans-serif;
    font-size: 22px;
    font-weight: 700;
}

.brand-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-block;
    object-fit: contain;
}

.help-link {
    color: #d4dbe8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.auth-main {
    flex: 1;
    position: relative;
    display: grid;
    place-items: center;
    padding: 20px 24px 60px;
    overflow: hidden;
}

.auth-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(7, 10, 18, 0.66), rgba(6, 10, 18, 0.96)),
        radial-gradient(circle at 50% -2%, rgba(255, 201, 82, 0.32), transparent 22%),
        url("https://images.unsplash.com/photo-1497032205916-ac775f0649ae?auto=format&fit=crop&w=1700&q=80") center/cover;
    transform: scale(1.04);
    filter: saturate(0.82);
    z-index: 0;
}

.auth-card {
    position: relative;
    z-index: 2;
    width: min(470px, 100%);
    border-radius: 16px;
    border: 1px solid var(--auth-line);
    background: linear-gradient(180deg, rgba(22, 27, 39, 0.78), rgba(13, 17, 28, 0.82));
    backdrop-filter: blur(6px);
    padding: 26px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.auth-card-wide {
    width: min(540px, 100%);
}

.auth-head {
    text-align: center;
    margin-bottom: 18px;
}

.auth-head h1 {
    font-size: clamp(38px, 5.4vw, 52px);
    line-height: 1;
    color: var(--auth-gold);
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.auth-head-sm {
    font-size: clamp(28px, 4.4vw, 38px) !important;
}

.auth-head p {
    color: #c3cbdb;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 500;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 6px;
}

.field label {
    color: #d7deeb;
    font-size: 13px;
    font-weight: 600;
}

.label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.forgot-link {
    color: var(--auth-gold);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: #c7cfde;
    line-height: 0;
    opacity: 0.85;
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--auth-line);
    background: rgba(33, 39, 53, 0.6);
    color: var(--auth-text);
    padding: 0 12px 0 38px;
    outline: none;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.input-wrap input.with-eye {
    padding-right: 42px;
}

.input-wrap input::placeholder {
    color: #8590a3;
}

.input-wrap input:focus {
    border-color: rgba(239, 198, 79, 0.7);
    background: rgba(33, 39, 53, 0.9);
}

.toggle-eye {
    position: absolute;
    right: 8px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #c7cfde;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.toggle-eye:hover {
    color: var(--auth-gold);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.terms {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #bcc5d6;
    font-size: 13px;
    font-weight: 500;
}

.terms input {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-gold);
}

.terms-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--auth-gold);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.terms-modal {
    position: fixed;
    top: 50vh;
    left: 50vw;
    transform: translate(-50%, -50%);
    width: min(680px, calc(100% - 32px));
    max-height: min(720px, calc(100vh - 48px));
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: #111722;
    color: var(--auth-text);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.68);
}

.terms-modal::backdrop {
    background: rgba(2, 5, 11, 0.82);
    backdrop-filter: blur(4px);
}

.terms-modal-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: min(720px, calc(100vh - 48px));
}

.terms-modal-header,
.terms-modal-footer {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--auth-line);
}

.terms-modal-header {
    justify-content: space-between;
    gap: 16px;
}

.terms-modal-header h2 {
    margin: 0;
    color: var(--auth-gold);
    font-size: 20px;
    line-height: 1.35;
}

.terms-modal-x {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: #cbd3e1;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.terms-modal-body {
    overflow-y: auto;
    padding: 20px;
    color: #d7deeb;
    font-size: 14px;
    line-height: 1.7;
}

.terms-modal-body img {
    max-width: 100%;
    height: auto;
}

.terms-modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--auth-line);
    border-bottom: 0;
}

.terms-modal-close {
    min-width: 88px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(239, 198, 79, 0.55);
    border-radius: 6px;
    background: transparent;
    color: var(--auth-gold);
    font-weight: 700;
    cursor: pointer;
}

.terms-document {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    background: rgba(7, 11, 20, 0.72);
    color: #d7deeb;
    font-size: 13px;
    line-height: 1.65;
}

.terms-document h2 {
    margin-bottom: 10px;
    color: var(--auth-gold);
    font-size: 17px;
}

.terms-document img {
    max-width: 100%;
    height: auto;
}

.btn-primary:disabled {
    cursor: not-allowed;
    filter: grayscale(0.7);
    opacity: 0.55;
}

.btn-primary {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(140deg, #f7da78 0%, var(--auth-gold-deep) 100%);
    color: #1d1500;
    font-weight: 700;
    cursor: pointer;
    font-size: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.01em;
    transition: filter 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-arrow {
    font-size: 17px;
    font-weight: 700;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9099ab;
    font-size: 12px;
    margin: 18px 0 14px;
    font-weight: 600;
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(255, 255, 255, 0.14);
}

.btn-google {
    width: 100%;
    height: 46px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(34, 40, 55, 0.78);
    color: #dce3f0;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-google:hover {
    background: rgba(50, 58, 78, 0.85);
    border-color: rgba(255, 255, 255, 0.28);
}

.google-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
}

.switch-row {
    text-align: center;
    margin-top: 14px;
    color: #b8c1d2;
    font-size: 14px;
    font-weight: 500;
}

.switch-row a {
    color: var(--auth-gold);
    text-decoration: none;
    margin-left: 6px;
    font-weight: 700;
}

.alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 600;
}

.alert.error {
    border: 1px solid rgba(255, 106, 106, 0.44);
    background: rgba(145, 37, 37, 0.26);
    color: #ffd5d5;
}

.alert.success {
    border: 1px solid rgba(111, 221, 154, 0.42);
    background: rgba(40, 126, 61, 0.25);
    color: #d8ffe3;
}

.alert a {
    color: var(--auth-gold);
    text-decoration: none;
    font-weight: 700;
    margin: 0 4px;
}

.auth-footer {
    position: relative;
    z-index: 3;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #070b14;
    padding: 22px 32px;
}

.auth-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.auth-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 260px;
}

.auth-footer-copy {
    color: #8a93a5;
    font-size: 12px;
}

.auth-footer-links {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.auth-footer-links a {
    color: #c7cfde;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.auth-footer-links a:hover {
    color: var(--auth-gold);
}

@media (max-width: 640px) {
    .auth-topbar {
        padding: 16px 18px;
    }

    .auth-main {
        padding: 12px 16px 40px;
    }

    .auth-card {
        padding: 20px;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .auth-footer {
        padding: 18px;
    }

    .auth-footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
