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

:root {
    --bg: #008080;
    --panel: #c0c0c0;
    --panel-dark: #a0a0a0;
    --panel-light: #e5e5e5;
    --text: #000000;
    --shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
}

body {
    font-family: "MS Sans Serif", "Tahoma", "Verdana", sans-serif;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--text);
}

.desktop {
    width: 100%;
    max-width: 28.75rem; /* 460px */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window {
    width: min(26.25rem, 92vw); /* 420px */
    background: var(--panel);
    border: 0.125rem solid #000;
    box-shadow: 0.25rem 0.25rem 0 rgba(0, 0, 0, 0.4);
    margin-top: -1.5rem;
}

.title-bar {
    background: linear-gradient(90deg, #000080, #0000a8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.375rem 0.5rem;
    font-weight: 700;
    letter-spacing: 0.0125rem;
    user-select: none;
    cursor: default;
}

.title-text {
    font-size: 0.8125rem;
}

.window-body {
    padding: 1rem;
    border-top: 0.125rem solid #7a7a7a;
    border-left: 0.125rem solid #fff;
    border-right: 0.125rem solid #7a7a7a;
    border-bottom: 0.125rem solid #7a7a7a;
    background: var(--panel);
}

.window-heading {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.heading-title {
    font-size: 1rem;
    font-weight: 700;
}

.heading-sub {
    font-size: 0.75rem;
    margin-top: 0;
}

.alert {
    display: none;
    background: #ffffe1;
    border: 0.125rem solid #7a7a7a;
    border-left-color: #fff;
    border-top-color: #fff;
    padding: 0.75rem 0.75rem;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

.alert.show {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: 6.25rem 1fr;
    gap: 0.625rem 0.75rem;
    align-items: center;
}

.form-label {
    font-size: 0.8125rem;
}

.input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    background: #fff;
    border: 0.125rem solid #7a7a7a;
    border-left-color: #fff;
    border-top-color: #fff;
    font-size: 0.875rem;
    outline: none;
}

.input:focus {
    border-color: #000;
    border-left-color: #fff;
    border-top-color: #fff;
}

.password-cell {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.password-toggle {
    width: 2.25rem;
    height: 2rem;
    background: #f0f0f0;
    border: 0.125rem solid #7a7a7a;
    border-left-color: #fff;
    border-top-color: #fff;
    cursor: pointer;
    font-family: inherit;
    display: grid;
    place-items: center;
    padding: 0;
}

.toggle-eye {
    width: 0.875rem;
    height: 0.625rem;
    border: 0.125rem solid #000;
    border-radius: 999px;
    position: relative;
    display: block;
}

.toggle-eye::after {
    content: '';
    position: absolute;
    width: 0.375rem;
    height: 0.375rem;
    background: #000;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.password-toggle.active .toggle-eye::after {
    background: #fff;
    border: 0.125rem solid #000;
}

.button-row {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.375rem;
}

.btn {
    min-width: 6rem;
    padding: 0.5rem 0.75rem;
    background: #c0c0c0;
    border: 0.125rem solid #7a7a7a;
    border-left-color: #fff;
    border-top-color: #fff;
    color: #000;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
}

.btn:active {
    border: 0.125rem solid #fff;
    border-left-color: #7a7a7a;
    border-top-color: #7a7a7a;
    background: #a0a0a0;
}

.spinner {
    width: 0.875rem;
    height: 0.875rem;
    border: 0.125rem solid #7a7a7a;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.loading .spinner {
    display: inline-block;
}

.loading .btn-text {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 600px) {
    body {
        padding: 0.75rem;
    }
    .desktop {
        min-height: 100vh;
        align-items: center;
        padding-top: 1rem;
    }
    .window {
        width: min(23.75rem, 96vw);
        margin-top: -4rem;
    }
    .form-grid {
        grid-template-columns: 5.625rem 1fr;
    }
}
