:root {
    --bg: #0f172a;
    --card: #1e293b;
    --card-hover: #334155;
    --text: #f8fafc;
    --text-light: #94a3b8;
    --primary: #06b6d4;
    --primary-glow: rgba(6, 182, 212, 0.2);
    --secondary: #14b8a6;
    --accent: #8b5cf6;
    --danger: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;
    --border: #334155;
    --surface: rgba(15, 23, 42, 0.72);
}

* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

body.theme-light {
    --bg: #f8fafc;
    --card: #ffffff;
    --card-hover: #e2e8f0;
    --text: #0f172a;
    --text-light: #475569;
    --primary: #0284c7;
    --primary-glow: rgba(2, 132, 199, 0.16);
    --secondary: #0f766e;
    --accent: #7c3aed;
    --danger: #dc2626;
    --success: #059669;
    --warning: #d97706;
    --border: #cbd5e1;
    --surface: rgba(255, 255, 255, 0.84);
}

.login-screen {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    background:
        radial-gradient(circle at 20% 12%, rgba(6, 182, 212, 0.18), transparent 34%),
        radial-gradient(circle at 82% 20%, rgba(20, 184, 166, 0.12), transparent 32%),
        linear-gradient(180deg, #111827 0%, var(--bg) 76%);
}

body.theme-light .login-screen {
    background:
        radial-gradient(circle at 18% 12%, rgba(2, 132, 199, 0.16), transparent 34%),
        radial-gradient(circle at 82% 20%, rgba(15, 118, 110, 0.12), transparent 32%),
        linear-gradient(180deg, #eef6ff 0%, var(--bg) 76%);
}

.login-screen > section {
    width: min(100%, 460px);
}

.login-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

body.theme-light .login-card {
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.45rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 12px 28px var(--primary-glow);
}

.auth-header h1 {
    margin: 0;
    color: var(--text);
    font-size: 1.75rem;
    line-height: 1.2;
}

.auth-header p {
    margin: 9px auto 0;
    color: var(--text-light);
    line-height: 1.5;
    max-width: 340px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    color: var(--text-light);
    font-size: 0.92rem;
    font-weight: 700;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    min-height: 50px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

body.theme-light .input-group input,
body.theme-light .input-group select,
body.theme-light .input-group textarea {
    background: #ffffff;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.text-danger {
    color: var(--danger);
    font-size: 0.86rem;
}

.btn {
    min-height: 50px;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 10px 25px var(--primary-glow);
}

.btn-primary:hover {
    opacity: 0.96;
}

.auth-link-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--text-light);
    font-size: 0.94rem;
    text-align: center;
}

.auth-link-row.single {
    margin-top: 4px;
}

.auth-legal-links,
.auth-legal-note {
    color: var(--text-light);
    font-size: 0.82rem;
    line-height: 1.45;
    margin-top: 14px;
    text-align: center;
}

.auth-legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.auth-legal-note {
    margin-bottom: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

a:visited {
    color: var(--primary);
}

a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    border: 1px solid transparent;
}

.alert:empty {
    display: none;
}

.alert-danger {
    background-color: rgba(244, 63, 94, 0.12);
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.35);
}

body.theme-light .alert-danger {
    color: #b91c1c;
    background-color: #fee2e2;
    border-color: #fecaca;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.35);
}

input[type="date"] {
    width: 100%;
    max-width: 100%;
    -webkit-appearance: none;
}

@media (max-width: 520px) {
    .login-screen {
        align-items: center;
        padding: 18px 12px 28px;
    }

    .login-card {
        padding: 24px 18px;
        border-radius: 16px;
    }

    .auth-header h1 {
        font-size: 1.48rem;
    }
}
