/* ログイン画面（管理者・従業員）共通のデザイン */
:root {
    --auth-bg: #f2f5fa;
    --auth-blob-1: rgba(31, 73, 124, 0.10);
    --auth-blob-2: rgba(56, 143, 214, 0.12);
    --auth-card: #ffffff;
    --auth-card-border: #e3e9f1;
    --auth-text: #1c2738;
    --auth-heading: #13243c;
    --auth-muted: #66758a;
    --auth-label: #3d4b5f;
    --auth-input-bg: #f6f8fb;
    --auth-input-border: #d9e1ec;
    --auth-primary: #1f497c;
    --auth-primary-2: #2b62a3;
    --auth-primary-hover: #183a63;
    --auth-accent: #388fd6;
    --auth-link: #1f497c;
    --auth-ring: rgba(31, 73, 124, 0.16);
    --auth-badge-admin-bg: rgba(31, 73, 124, 0.08);
    --auth-badge-admin-fg: #1f497c;
    --auth-badge-emp-bg: rgba(56, 143, 214, 0.12);
    --auth-badge-emp-fg: #1f6fae;
    --auth-shadow: 0 1px 2px rgba(16, 32, 56, 0.04), 0 12px 32px rgba(16, 32, 56, 0.08);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --auth-bg: #0e1622;
        --auth-blob-1: rgba(56, 143, 214, 0.10);
        --auth-blob-2: rgba(31, 73, 124, 0.22);
        --auth-card: #152131;
        --auth-card-border: #24344a;
        --auth-text: #e3e9f2;
        --auth-heading: #f1f5fb;
        --auth-muted: #93a3b8;
        --auth-label: #c3cedc;
        --auth-input-bg: #0f1926;
        --auth-input-border: #2a3b52;
        --auth-primary: #2b62a3;
        --auth-primary-2: #3a7cc7;
        --auth-primary-hover: #3a7cc7;
        --auth-ring: rgba(58, 124, 199, 0.28);
        --auth-link: #9cc4ee;
        --auth-badge-admin-bg: rgba(58, 124, 199, 0.16);
        --auth-badge-admin-fg: #9cc4ee;
        --auth-badge-emp-bg: rgba(56, 143, 214, 0.18);
        --auth-badge-emp-fg: #8fd0ff;
        --auth-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.35);
    }
}
:root[data-theme="dark"] {
    --auth-bg: #0e1622;
    --auth-blob-1: rgba(56, 143, 214, 0.10);
    --auth-blob-2: rgba(31, 73, 124, 0.22);
    --auth-card: #152131;
    --auth-card-border: #24344a;
    --auth-text: #e3e9f2;
    --auth-heading: #f1f5fb;
    --auth-muted: #93a3b8;
    --auth-label: #c3cedc;
    --auth-input-bg: #0f1926;
    --auth-input-border: #2a3b52;
    --auth-primary: #2b62a3;
    --auth-primary-2: #3a7cc7;
    --auth-primary-hover: #3a7cc7;
    --auth-ring: rgba(58, 124, 199, 0.28);
    --auth-link: #9cc4ee;
    --auth-badge-admin-bg: rgba(58, 124, 199, 0.16);
    --auth-badge-admin-fg: #9cc4ee;
    --auth-badge-emp-bg: rgba(56, 143, 214, 0.18);
    --auth-badge-emp-fg: #8fd0ff;
    --auth-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.auth-body {
    font-family: 'Noto Sans JP', system-ui, -apple-system, sans-serif;
    background-color: var(--auth-bg);
    background-image:
        radial-gradient(600px 400px at 0% 0%, var(--auth-blob-1), transparent 70%),
        radial-gradient(700px 500px at 100% 100%, var(--auth-blob-2), transparent 70%);
    background-attachment: fixed;
    color: var(--auth-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    -webkit-font-smoothing: antialiased;
}
.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--auth-card);
    border: 1px solid var(--auth-card-border);
    border-radius: 18px;
    box-shadow: var(--auth-shadow);
    padding: 40px 36px 30px;
    overflow: hidden;
}
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--auth-primary), var(--auth-accent));
}
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo img { height: 38px; max-width: 100%; }
html[data-theme="dark"] .auth-logo img { content: url("../logo2.png"); }
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .auth-logo img { content: url("../logo2.png"); }
}
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.auth-badge.admin { background: var(--auth-badge-admin-bg); color: var(--auth-badge-admin-fg); }
.auth-badge.employee { background: var(--auth-badge-emp-bg); color: var(--auth-badge-emp-fg); }
.auth-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--auth-heading);
}
.auth-desc { margin: 6px 0 0; font-size: 0.85rem; color: var(--auth-muted); }

.auth-field { margin-bottom: 18px; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; gap: 8px; }
.auth-label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--auth-label); margin-bottom: 7px; }
.auth-label-row .auth-label { margin-bottom: 0; }
.auth-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font: inherit;
    font-size: 1rem;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.auth-input::placeholder { color: var(--auth-muted); opacity: 0.75; }
.auth-input:focus {
    border-color: var(--auth-primary);
    background: var(--auth-card);
    box-shadow: 0 0 0 4px var(--auth-ring);
}
.auth-link {
    color: var(--auth-link);
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
}
.auth-link:hover { text-decoration: underline; }

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--auth-muted);
    cursor: pointer;
    margin: 4px 0 22px;
}
.auth-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--auth-primary); }

.auth-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-2));
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    box-shadow: 0 6px 16px -6px rgba(31, 73, 124, 0.55);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.auth-btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 10px 22px -8px rgba(31, 73, 124, 0.6); }
.auth-btn:active { transform: translateY(0); filter: brightness(0.96); }
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--auth-ring); }

.auth-divider { height: 1px; background: var(--auth-card-border); margin: 26px 0 18px; }
.auth-footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 0.85rem;
}
.auth-footer-links a { color: var(--auth-muted); text-decoration: none; transition: color 0.15s ease; }
.auth-footer-links a:hover { color: var(--auth-link); }
.auth-footer-links a.auth-switch { color: var(--auth-link); font-weight: 500; }
.auth-copy { margin-top: 22px; font-size: 0.75rem; color: var(--auth-muted); opacity: 0.8; text-align: center; }

@media (max-width: 480px) {
    .auth-card { padding: 32px 22px 24px; border-radius: 16px; }
    .auth-title { font-size: 1.25rem; }
}

/* 送信中の表示 */
#globalLoadingOverlay {
    display: none; position: fixed; inset: 0; z-index: 9999;
    flex-direction: column; justify-content: center; align-items: center;
    background: rgba(242, 245, 250, 0.75); backdrop-filter: blur(4px);
    color: var(--auth-heading);
}
html[data-theme="dark"] #globalLoadingOverlay { background: rgba(14, 22, 34, 0.75); }
#globalLoadingOverlay .spinner {
    width: 46px; height: 46px; border-radius: 50%;
    border: 4px solid var(--auth-card-border); border-top-color: var(--auth-primary);
    animation: auth-spin 1s linear infinite; margin-bottom: 18px;
}
#globalLoadingOverlay h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
#globalLoadingOverlay p { margin: 5px 0 0; font-size: 0.85rem; color: var(--auth-muted); }
@keyframes auth-spin { to { transform: rotate(360deg); } }
