:root {
    --bg-aqua: #04dbe0;
    --bg-sky: #768eef;
    --bg-lav: #a57fe3;
    --bg-mag: #BB366F;
    --card: #ffffff;
    --ink: #121418;
    --muted: #8b8f98;
    --line: #eef1f6;
    --btn-left: #3ad1df;
    --btn-mid: #a887ee;
    --btn-right: #BB366F;
    --success: #1f9d50;
    --warning: #f0a100;
    --danger: #d14343;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    background: linear-gradient(135deg,
        var(--bg-aqua) 0%,
        var(--bg-sky) 28%,
        var(--bg-lav) 58%,
        var(--bg-mag) 100%);
    font-family: "Poppins", "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
}

.page {
    min-height: 100%;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    padding: 32px;
}

.auth-brand {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.auth-brand img {
    display: block;
    height: 48px;
}

.auth-brand span {
    font-weight: 600;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    font-size: 12px;
}

.shape {
    position: absolute;
    pointer-events: none;
    filter: blur(2px);
    opacity: 0.18;
    background: linear-gradient(135deg, #ffffff, rgba(255, 255, 255, 0.35));
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(6px);
}

.shape.s1 {
    width: 280px;
    height: 160px;
    bottom: -40px;
    left: -40px;
    border-radius: 28px;
    transform: rotate(8deg);
}

.shape.s2 {
    width: 220px;
    height: 220px;
    top: -70px;
    right: -50px;
    border-radius: 40px;
    transform: rotate(-12deg);
}

.shape.s3 {
    width: 140px;
    height: 90px;
    top: 18%;
    left: 6%;
    border-radius: 20px;
    transform: rotate(-6deg);
}

.shape.s4 {
    width: 170px;
    height: 110px;
    bottom: 20%;
    right: 10%;
    border-radius: 26px;
    transform: rotate(5deg);
}

.card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border-radius: 16px;
    padding: 36px 32px 28px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.18),
        0 6px 18px rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 1;
}

.title {
    margin: 0 0 18px 0;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--ink);
    font-size: clamp(24px, 2.2vw, 28px);
}

.field {
    margin: 12px 0 8px;
}

.field-row {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: end;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    position: relative;
}

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    width: 28px;
    opacity: 0.8;
}

.icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.select-row {
    position: relative;
}

.select-row::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 12px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid rgba(18, 20, 24, 0.35);
    pointer-events: none;
}

.select-row select.input {
    padding-right: 22px;
}

.select-row select {
    background: transparent;
    border: 0;
    color: var(--ink);
    font-size: 15px;
    width: 100%;
    appearance: none;
}

.input {
    width: 100%;
    border: 0;
    outline: none;
    font-size: 15px;
    padding: 2px 0 0;
    background: transparent;
    color: var(--ink);
}

.input::placeholder {
    color: #a3a8b3;
}

.input:focus {
    outline: none;
}

.field-row:focus-within {
    border-bottom-color: #dfe4ee;
    box-shadow: inset 0 -1px 0 #dfe4ee;
}

.toggle-password {
    position: absolute;
    right: 0;
    bottom: 6px;
    background: none;
    border: 0;
    color: rgba(18, 20, 24, 0.55);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.toggle-password:hover,
.toggle-password:focus {
    color: rgba(18, 20, 24, 0.85);
}

.toggle-password.revealed {
    color: var(--btn-mid);
}

.field-hint {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(18, 20, 24, 0.6);
}

.forgot {
    display: block;
    text-align: right;
    margin-top: 8px;
    font-size: 12.5px;
    color: #8c91a1;
    text-decoration: none;
}

.forgot:hover {
    color: #6f7380;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 18px;
    border: 0;
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffffff;
    border-radius: 999px;
    background-image: linear-gradient(90deg, var(--btn-left), var(--btn-mid), var(--btn-right));
    background-size: 200% 100%;
    transition: transform 200ms ease, box-shadow 200ms ease, background-position 300ms ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -8px 14px rgba(0, 0, 0, 0.12),
        0 10px 24px rgba(124, 16, 170, 0.35);
    position: relative;
}

.btn::before {
    content: "";
    position: absolute;
    left: 8%;
    top: 10%;
    width: 84%;
    height: 40%;
    border-radius: 999px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
    pointer-events: none;
    filter: blur(0.2px);
}

.btn:hover {
    transform: translateY(-1px);
    background-position: 100% 0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.60),
        inset 0 -10px 16px rgba(0, 0, 0, 0.12),
        0 14px 30px rgba(124, 16, 170, 0.45);
}

.btn:active {
    transform: translateY(0);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.18),
        0 8px 18px rgba(124, 16, 170, 0.28);
}

.signup {
    margin-top: 12px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
}

.signup a {
    color: #6f7380;
    text-decoration: none;
    font-weight: 600;
    margin-left: 6px;
}

.signup a:hover {
    color: #4c505b;
}

.inline-check {
    margin-top: 16px;
}

.inline-check label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
}

.inline-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--btn-mid);
}

.alert-banner {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-banner svg {
    width: 18px;
    height: 18px;
}

.alert-banner.success {
    background: rgba(31, 157, 80, 0.12);
    color: var(--success);
}

.alert-banner.warning {
    background: rgba(240, 161, 0, 0.14);
    color: var(--warning);
}

.alert-banner.danger {
    background: rgba(209, 67, 67, 0.14);
    color: var(--danger);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.muted-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: rgba(18, 20, 24, 0.65);
    text-decoration: none;
}

.muted-link:hover {
    color: rgba(18, 20, 24, 0.8);
}

@media (prefers-reduced-motion: reduce) {
    .btn {
        transition: none;
    }
}

@media (max-width: 576px) {
    .auth-brand {
        top: 14px;
        left: 16px;
    }

    .auth-brand img {
        height: 40px;
    }
}
