:root {
    --bg: rgba(9, 42, 60, 0.4);
    --panel: #0c0c15;
    --panel-2: #111120;
    --violet: #8b6bff;
    --violet-dim: #6c53c9;
    --orange: #ff9a52;
    --text: #f3f1f8;
    --text-dim: #9a94b5;
    --border: rgba(255, 255, 255, 0.09);
    --input-bg: rgba(255, 255, 255, 0.035);
    --danger: #ff6b6b;
    --radius: 14px;
}
* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", sans-serif;
    overflow: hidden;
}
.page {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ---------- Full-screen fish tank ---------- */
#fishtank {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ---------- Floating glass auth panel (fish swim behind it) ---------- */
.auth-side {
    position: absolute;
    top: 50%;
    right: 5vw;
    transform: translateY(-50%);
    z-index: 5;
    width: 420px;
    max-width: 92vw;
    max-height: 88vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    background: rgba(9, 42, 60, 0.4);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    box-shadow:
        0 25px 70px -20px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 2.3rem 2.1rem;
    perspective: 1800px;
    scrollbar-width: thin;
}
.auth-header {
    text-align: center;
}
.auth-eyebrow {
    font-family: "Space Grotesk", sans-serif;
    font-size: 18px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: #7fe8d4;
    margin: 0 0 10px;
    opacity: 0.9;
}
.auth-title {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 2.6vw, 32px);
    line-height: 1.1;
    margin: 0 0 8px;
    background: linear-gradient(135deg, #fdfcff 0%, #bdeeff 50%, #7fe8d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth-header p.auth-dept {
    font-size: 16px;
    color: #a9d6e4;
    margin: 0;
    letter-spacing: 0.01em;
}
.auth-card {
    position: relative;
    display: grid;
    align-items: start;
    width: 100%;
    max-width: 360px;
    transform-style: preserve-3d;
    transition: transform 0.85s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.auth-card.flipped {
    transform: rotateY(180deg);
}
.card-face {
    grid-column: 1;
    grid-row: 1;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.card-face.back {
    transform: rotateY(180deg);
}

.card-face h2 {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    font-size: 26px;
    margin: 0 0 6px;
}
.card-face .sub {
    font-size: 13.5px;
    color: var(--text-dim);
    margin: 0 0 1.8rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.field label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}
.field input {
    width: 100%;
    height: 44px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 14px;
    color: var(--text);
    font-family: "Inter", sans-serif;
    font-size: 14px;
    outline: none;
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}
.field input::placeholder {
    color: #5f5a76;
}
.field input:focus {
    border-color: var(--violet);
    background: rgba(139, 107, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(139, 107, 255, 0.14);
}

.pw-wrap {
    position: relative;
}
.pw-wrap input {
    padding-right: 44px;
}
.eye-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition:
        color 0.15s ease,
        background 0.15s ease;
}
.eye-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}
.eye-btn svg {
    width: 18px;
    height: 18px;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -2px;
}
.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
    cursor: pointer;
    user-select: none;
}
.remember input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--input-bg);
    cursor: pointer;
    position: relative;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
    flex-shrink: 0;
}
.remember input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--violet), #6f52e0);
    border-color: var(--violet);
}
.remember input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(40deg);
}
.link {
    font-size: 13px;
    color: var(--violet);
    text-decoration: none;
}
.link:hover {
    text-decoration: underline;
}

.btn-primary {
    height: 46px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(
        135deg,
        var(--violet) 0%,
        #6f52e0 55%,
        var(--orange) 130%
    );
    color: #fff;
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    margin-top: 4px;
    box-shadow: 0 8px 22px -8px rgba(139, 107, 255, 0.55);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        filter 0.15s ease;
}
.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px -6px rgba(139, 107, 255, 0.5);
}

.switch-text {
    text-align: center;
    font-size: 13.5px;
    color: var(--text-dim);
    margin: 1.6rem 0 0;
}
.switch-text a {
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--violet);
    cursor: pointer;
}
.switch-text a:hover {
    color: var(--violet);
}

.copyright {
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(169, 214, 228, 0.55);
    margin: 0;
    letter-spacing: 0.01em;
}

.alert {
    position: relative;
    padding: 18px 46px 18px 24px;
    margin-bottom: 1rem;
    border: 0.1rem solid #58151c;
    border-radius: 7px;
    font-size: 16px;
    line-height: 1.5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.alert-danger {
    color: #58151c;
    background-color: #fbd9dc;
}

.alert ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.alert ul li {
    position: relative;
    padding-left: 18px;
}

.alert ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #58151c;
}

.alert-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    font-size: 36px;
    line-height: 1;
    font-weight: 300;
    color: #8a8a8a;
    opacity: 1;
    cursor: pointer;
    padding: 0;
}

.alert-close:hover {
    color: #555;
}

@media (max-width: 900px) {
    .auth-side {
        right: 50%;
        transform: translate(50%, -50%);
        width: 92vw;
        padding: 1.8rem 1.6rem;
        gap: 1.2rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    .auth-card {
        transition: none;
    }
}
