:root {
    color-scheme: light;
    --bg: #f5f7f8;
    --bg-strong: #e9eff1;
    --panel: #ffffff;
    --text: #172126;
    --muted: #65737b;
    --line: #d8e0e4;
    --accent: #000;
    --accent-dark: #333;
    --danger: #9c2f2f;
    --danger-bg: #fff1f1;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-strong) 100%);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell,
.login-shell {
    width: min(760px, calc(100vw - 32px));
    margin: 48px auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 18px 50px rgba(19, 37, 45, 0.08);
}

.login-page {
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.login-shell {
    width: min(460px, calc(100vw - 32px));
    margin: 0 auto;
}

.login-panel {
    display: grid;
    gap: 18px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 700;
}

.login-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    letter-spacing: 0;
}

.app-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

h1 {
    margin: 0 0 6px;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.15;
    letter-spacing: 0;
}

p {
    margin: 0 0 24px;
    color: var(--muted);
}

.login-panel p {
    margin: 0;
}

form {
    display: grid;
    gap: 18px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-weight: 650;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    color: var(--text);
    background: #fff;
    font: inherit;
}

input:focus,
textarea:focus {
    outline: 3px solid rgba(18, 107, 104, 0.18);
    border-color: var(--accent);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

.hint {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 450;
}

button {
    justify-self: start;
    min-width: 148px;
    border: 0;
    border-radius: 6px;
    padding: 12px 18px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

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

a.logout-link {
    color: var(--accent-dark);
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

a.logout-link:hover {
    text-decoration: underline;
}

button:disabled {
    cursor: progress;
    opacity: 0.76;
}

.alert {
    margin: 0 0 22px;
    border: 1px solid rgba(156, 47, 47, 0.22);
    border-radius: 6px;
    padding: 12px 14px;
    background: var(--danger-bg);
    color: var(--danger);
    font-weight: 650;
}

@media (max-width: 560px) {
    .app-shell,
    .login-shell {
        margin: 24px auto;
        padding: 24px;
    }

    .app-header {
        display: grid;
    }

    .logout-link {
        justify-self: start;
    }
}
