:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    background-color: #f5f5f7;
    color: #000;
    transition: background-color 0.3s ease, color 0.3s ease;
    --page-bg: #f5f5f7;
    --card-bg: #ffffff;
    --input-bg: #fafafa;
    --input-focus-bg: #ffffff;
}

:root.dark {
    color-scheme: dark;
    background-color: #111827;
    color: #f5f5f7;
    --page-bg: #111827;
    --card-bg: #1f2937;
    --input-bg: #1f2937;
    --input-focus-bg: #111827;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--page-bg);
    transition: background-color 0.3s ease;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    cursor: pointer;
    font-size: 20px;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 0, 0, 0.3);
}

.theme-toggle:active {
    transform: translateY(0);
}

.login-card {
    width: min(360px, calc(100% - 40px));
    padding: 40px 36px;
    background: var(--card-bg);
    border-radius: 22px;
    box-shadow: 0 20px 50px rgba(31, 41, 55, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.login-card h1 {
    margin: 0 0 28px;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.01em;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    font-size: 16px;
    background-color: var(--input-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input:focus {
    border-color: rgba(0, 0, 0, 0.4);
    background-color: var(--input-focus-bg);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
    outline: none;
}

.field {
    margin-bottom: 20px;
}

button[type="submit"] {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    background: #111827;
    color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px rgba(17, 24, 39, 0.18);
}

button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 10px 18px rgba(17, 24, 39, 0.2);
}

:root.dark .theme-toggle {
    background: rgba(26, 32, 44, 0.78);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f5f5f7;
}

:root.dark .theme-toggle:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

:root.dark button[type="submit"] {
    background: #f5f5f7;
    color: #111827;
    box-shadow: none;
}

:root.dark button[type="submit"]:hover {
    box-shadow: 0 18px 28px rgba(245, 245, 247, 0.18);
}

:root.dark input {
    border: 1px solid rgba(255, 255, 255, 0.12);
}
