@charset "UTF-8";

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --primary-pale: #f5f9ff;
    --navy: #0f2a44;
    --text: #1f2937;
    --muted: #6b7280;
    --subtle: #94a3b8;
    --border: #d8e2ee;
    --border-strong: #b8c8da;
    --surface: #ffffff;
    --bg: #f8fafc;
    --success: #10b981;
    --success-soft: #ecfdf5;
    --warning: #f59e0b;
    --warning-soft: #fff7e6;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-soft: #fff1f2;
    --shadow-xs: 0 1px 2px rgba(15, 42, 68, .04);
    --shadow-sm: 0 5px 18px rgba(15, 42, 68, .07);
    --shadow-md: 0 16px 42px rgba(37, 99, 235, .10);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --content-width: 1180px;
    --header-height: 72px;
    --transition: 160ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic UI", sans-serif;
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { color: var(--navy); line-height: 1.35; letter-spacing: -.025em; }
h1 { margin: 0 0 .45em; font-size: clamp(1.75rem, 3.5vw, 2.55rem); }
h2 { margin: 1.4em 0 .65em; font-size: clamp(1.25rem, 2.4vw, 1.65rem); }
h3 { margin: 1em 0 .45em; font-size: 1.05rem; }
p { margin: .4em 0 1em; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition), opacity var(--transition); }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

input, select, textarea {
    width: 100%;
    min-height: 46px;
    padding: .72rem .88rem;
    color: var(--navy);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
textarea { min-height: 120px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--subtle); }
input:hover, select:hover, textarea:hover { border-color: #93b4dc; }
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
input:disabled, select:disabled, textarea:disabled { color: var(--subtle); background: #f1f5f9; cursor: not-allowed; }
label { display: grid; gap: .38rem; margin-bottom: 1rem; color: var(--navy); font-size: .9rem; font-weight: 700; }
label small { font-weight: 400; }
.check { display: flex; align-items: center; gap: .65rem; min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { width: 19px; min-height: 19px; height: 19px; accent-color: var(--primary); }

.site-header {
    position: sticky;
    z-index: 50;
    top: 0;
    min-height: var(--header-height);
    padding: 0 max(24px, calc((100vw - var(--content-width)) / 2));
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(216, 226, 238, .85);
    box-shadow: var(--shadow-xs);
    backdrop-filter: blur(14px);
}
.site-header .logout-form { margin-left: auto; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; color: var(--navy); font-size: 1.38rem; font-weight: 800; letter-spacing: -.04em; }
.brand::before {
    content: "";
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    margin-right: .7rem;
    border-radius: 9px;
    background: linear-gradient(145deg, #3b82f6, #155eef);
    box-shadow: inset 0 0 0 6px rgba(255,255,255,.92), 0 5px 12px rgba(37,99,235,.22);
}
.brand:has(img)::before { content: none; }
.brand img { display: block; height: 34px; width: auto; }
.brand:hover { color: var(--primary); }
.logout-form { margin: 0; }
.link-button { min-height: 42px; padding: .55rem .9rem; color: var(--primary); background: transparent; border: 0; font-weight: 700; }
.header-nav { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.header-nav__links { display: flex; align-items: center; gap: .1rem; margin-right: .4rem; }
.header-nav__links a { padding: .45rem .68rem; border-radius: 8px; color: var(--navy); font-weight: 700; font-size: .875rem; white-space: nowrap; transition: color var(--transition), background var(--transition); }
.header-nav__links a:hover, .header-nav__links a:focus-visible { color: var(--primary); background: var(--primary-soft); }
.header-nav > a {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px; padding: .5rem 1.05rem;
    border: 1.5px solid transparent; border-radius: 999px;
    font-weight: 700; font-size: .88rem; white-space: nowrap;
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.header-nav__login { color: var(--primary); background: var(--primary-soft); border-color: #bcd6f7; }
.header-nav__login:hover, .header-nav__login:focus-visible { color: var(--primary-hover); background: #e3eeff; border-color: var(--primary); }
.header-nav__cta { color: #fff; background: var(--primary); box-shadow: 0 6px 16px rgba(37, 99, 235, .24); }
.header-nav__cta:hover, .header-nav__cta:focus-visible { color: #fff; background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 9px 22px rgba(37, 99, 235, .3); }
@media (max-width: 1040px) { .header-nav__links { display: none; } }
@media (max-width: 700px) { .brand img { height: 32px; } }
@media (max-width: 600px) {
    .site-header { gap: .5rem; padding: 0 13px; }
    .header-nav { gap: .35rem; }
    .header-nav > a { font-size: .8rem; min-height: 36px; padding: .4rem .8rem; }
}
@media (max-width: 460px) {
    .brand img { height: 28px; }
    .header-nav > a { padding: .38rem .68rem; }
}
@media (max-width: 380px) { .brand img { height: 24px; } .header-nav > a { font-size: .76rem; padding: .35rem .56rem; } }
@media (max-width: 480px) { .header-nav__full { display: none; } }
@media (prefers-reduced-motion: reduce) { .header-nav__cta:hover, .header-nav__cta:focus-visible { transform: none; } }

.public-content { width: min(100%, calc(var(--content-width) + 40px)); min-height: calc(100vh - 150px); margin: 0 auto; padding: 42px 20px; }
.site-footer { padding: 30px 20px 34px; color: var(--muted); background: var(--surface); border-top: 1px solid var(--border); text-align: center; font-size: .86rem; }
.site-footer__logo { display: block; width: 42px; height: auto; margin: 0 auto 10px; }
.site-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 4px 0 12px; padding: 0; list-style: none; }
.site-footer__links a { color: var(--muted); font-weight: 600; }
.site-footer__links a:hover, .site-footer__links a:focus-visible { color: var(--primary); }
.site-footer p { margin: 0; }

.form-card, .confirmation-card, .empty-state {
    margin: 1rem 0;
    padding: clamp(1.25rem, 3vw, 2rem);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.form-card > :first-child, .confirmation-card > :first-child { margin-top: 0; }
.narrow { max-width: 580px; margin: 2rem auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.form-links { margin: 1rem 0 0; font-size: .9rem; }
.form-links a { color: var(--primary); font-weight: 600; }

.primary-button, .secondary-button, .danger-button, button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .7rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
    transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.primary-button { color: #fff; background: var(--primary); box-shadow: 0 7px 18px rgba(37, 99, 235, .22); }
.primary-button:hover { color: #fff; background: var(--primary-hover); box-shadow: 0 9px 22px rgba(37, 99, 235, .28); transform: translateY(-1px); }
.secondary-button { color: var(--primary); background: var(--surface); border-color: #a9c7f4; }
.secondary-button:hover { color: var(--primary-hover); background: var(--primary-soft); border-color: var(--primary); }
.danger-button { color: #fff; background: var(--danger); box-shadow: 0 7px 18px rgba(239, 68, 68, .18); }
.danger-button:hover { color: #fff; background: var(--danger-hover); transform: translateY(-1px); }
button:not([class]) { color: var(--navy); background: #f1f5f9; border-color: var(--border); }
button:not([class]):hover { background: #e8eef5; }

.flash { margin: 0 0 1rem; padding: .85rem 1rem .85rem 1.15rem; border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 700; }
.flash-success { color: #047857; background: var(--success-soft); border-color: #a7f3d0; }
.flash-error { color: #b91c1c; background: var(--danger-soft); border-color: #fecdd3; }
.empty-state { padding: 3.5rem 1.5rem; color: var(--muted); text-align: center; box-shadow: none; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .85rem 1rem; border-bottom: 1px solid #e8eef5; text-align: left; white-space: nowrap; vertical-align: middle; }
th { color: #557089; background: #f7faff; font-size: .78rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }
small { color: var(--muted); }
code { padding: .15em .4em; color: #315271; background: #eef4fa; border-radius: 5px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .84em; }
dl { display: grid; grid-template-columns: minmax(110px, 9rem) 1fr; gap: .75rem 1.5rem; margin: 0; }
dt { color: var(--muted); font-size: .85rem; font-weight: 700; }
dd { margin: 0; color: var(--navy); font-weight: 600; }

:focus-visible { outline: 3px solid rgba(37, 99, 235, .42); outline-offset: 3px; }
::selection { color: #fff; background: var(--primary); }

@media (max-width: 700px) {
    :root { --header-height: 62px; }
    body { font-size: 14px; }
    .site-header { padding: 0 16px; }
    .brand { font-size: 1.18rem; }
    .brand::before { width: 30px; height: 30px; }
    .public-content { padding: 26px 14px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-card, .confirmation-card { padding: 1.15rem; border-radius: 12px; }
    .primary-button, .secondary-button, .danger-button { width: 100%; }
    dl { grid-template-columns: 1fr; gap: .15rem; }
    dd { margin-bottom: .75rem; }
    th, td { padding: .72rem .8rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
