:root {
    color-scheme: dark;
    --background: #101823;
    --surface: rgba(17, 27, 39, 0.88);
    --border: rgba(151, 171, 194, 0.28);
    --text: #f1f4f7;
    --muted: #8491a0;
    --accent: #7d9dca;
    --accent-hover: #8cadd7;
    --danger: #e67b7b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    font-family: "Nunito Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--background);
}

button,
input {
    font: inherit;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(90deg, rgba(17, 26, 37, 0.2), rgba(11, 18, 27, 0.44)),
        url('../images/login-background.png') center / cover no-repeat;
}

.login-area {
    display: flex;
    width: min(100%, 450px);
    align-items: center;
    flex-direction: column;
}

.login-logo {
    position: relative;
    z-index: 2;
    width: 220px;
    height: 220px;
    margin-bottom: -54px;
    object-fit: contain;
    filter: drop-shadow(0 14px 15px rgba(0, 0, 0, 0.5));
}

.login-card {
    display: grid;
    width: 100%;
    gap: 22px;
    padding: 64px 46px 44px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
}

.field {
    display: grid;
    gap: 8px;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 14px 45px 14px 43px;
    border: 0;
    border-radius: 10px;
    outline: none;
    color: var(--text);
    background: transparent;
}

.input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 123, 155, 0.2);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid rgba(115, 136, 160, 0.22);
    border-radius: 10px;
    background: rgba(16, 25, 36, 0.62);
    transition: border-color 160ms, box-shadow 160ms;
}

.input-wrap > svg {
    position: absolute;
    left: 14px;
    width: 18px;
    color: #8d9aaa;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.password-toggle {
    position: absolute;
    right: 5px;
    display: grid;
    width: 38px;
    height: 38px;
    padding: 9px;
    border: 0;
    color: #8d9aaa;
    background: transparent;
    place-items: center;
}

.password-toggle:hover {
    color: #dbe4ee;
    background: transparent;
}

.submit-button {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
    font-weight: 700;
    transition: background 160ms, opacity 160ms;
}

.submit-button span {
    flex: 1;
    padding-left: 22px;
}

.submit-button svg {
    width: 22px;
    margin-right: 18px;
}

.submit-button:hover {
    background: var(--accent-hover);
}

.submit-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.form-message {
    min-height: 1.25em;
    margin: -4px 0;
    color: var(--danger);
    font-size: 0.9rem;
}

.form-message.success {
    color: #7ed5a3;
}

.setup-logo {
    width: 150px;
    height: 150px;
    margin-bottom: -40px;
}

.setup-card {
    gap: 16px;
    padding-top: 54px;
}

.setup-card input {
    padding-left: 14px;
}

.setup-header h1 {
    margin: 0 0 5px;
    font-size: 1.4rem;
}

.setup-header p {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.back-link {
    color: #aebdce;
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
}

.back-link:hover {
    color: #fff;
}

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

    .login-logo {
        width: 180px;
        height: 180px;
        margin-bottom: -44px;
    }

    .login-card {
        padding: 54px 24px 30px;
    }
}
