:root {
    --bg: #f2f8f8;
    --panel: #f9fdfd;
    --card: #ffffff;
    --muted: #4f647d;
    --primary: #008080;
    --primary-soft: rgba(0, 128, 128, 0.12);
    --success: #1ea672;
    --danger: #dc3545;
    --warning: #d28a00;
    --text: #14233b;
    --line: rgba(20, 35, 59, 0.1);
    --shadow: rgba(17, 24, 39, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(180deg, #f4f9f9 0%, #e6f0f0 100%);
    color: var(--text);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.project-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--primary) 0%, #20b2aa 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(0, 128, 128, 0.18);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.btn-secondary {
    padding: 10px 16px;
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inline-form { display: inline-flex; margin: 0; }

button.btn-secondary { font-family: inherit; cursor: pointer; }

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px 60px;
}

.login-card {
    width: min(100%, 420px);
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 32px 28px;
    box-shadow: 0 12px 28px var(--shadow);
}

.login-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 24px;
    text-align: center;
}

.login-card .lead {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.5;
    text-align: center;
    font-size: 14px;
}

.field-group {
    margin-bottom: 18px;
}

.field-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 14px;
}

input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

button[type="submit"] {
    width: 100%;
    margin-top: 6px;
    padding: 12px 18px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--primary) 0%, #20b2aa 100%);
    color: white;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 128, 128, 0.18);
}

button[type="submit"]:hover {
    opacity: 0.92;
}

button[type="submit"]:focus-visible {
    outline: 3px solid var(--primary-soft);
    outline-offset: 2px;
}

.messages {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.alert {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    background: #ffffff;
    font-size: 14px;
    line-height: 1.45;
}

.alert-success { border-left-color: var(--success); }
.alert-error { border-left-color: var(--danger); }
.alert-warning { border-left-color: var(--warning); }

.security-note {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.app-footer {
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 20px;
    text-align: center;
    font-size: 0.92rem;
}

@media (max-width: 520px) {
    .brand-subtitle { display: none; }
    .login-card { padding: 28px 20px; }
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
    font-size: 14px;
}

.anonymous-access {
    margin-top: 18px;
    text-align: center;
}

.anonymous-access .divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 13px;
}

.anonymous-access .divider::before,
.anonymous-access .divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--line);
}

.access-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.field-help {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}
