/* 이수증과 같은 글꼴(프리텐다드). 자주 쓰는 한글 2,350자와 영문·숫자만 담은 가벼운 판이다. */
@font-face { font-family: "Pretendard"; font-weight: 400; font-display: swap; src: url(/static/fonts/Pretendard-Regular.woff2) format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 600; font-display: swap; src: url(/static/fonts/Pretendard-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 700; font-display: swap; src: url(/static/fonts/Pretendard-Bold.woff2) format("woff2"); }
:root {
  --navy: #1E4A80; --navy-deep: #173B6B; --indigo: #2B2F7C; --teal: #3799A2; --teal-bright: #7FE3E9;
  --label: #1F7A85; --ink: #16202B; --sub: #5B6673; --line: #DDE5EE; --bg: #EDF2F7;
  --error: #B3261E; --warn-bg: #FFF4D6; --ok-bg: #DFF5EC; --tint: #EAF6F7;
  --grad: linear-gradient(100deg, #1E4A80 0%, #1F6F8B 60%, #3799A2 100%);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }

/* ── 위쪽 띠: 로그인 화면과 같은 바탕과 무늬, 그 안에 메뉴와 화면 제목 ── */
.top { position: relative; overflow: hidden; color: #fff; padding-bottom: 76px;
  background:
    radial-gradient(70% 160% at 100% 100%, rgba(55, 153, 162, 0.95) 0%, rgba(55, 153, 162, 0) 62%),
    radial-gradient(60% 140% at 0% 0%, var(--indigo) 0%, rgba(43, 47, 124, 0) 66%),
    linear-gradient(120deg, var(--navy-deep) 0%, var(--navy) 50%, #1B6F86 100%); }
.top-art { position: absolute; right: -150px; top: -210px; width: 620px; height: 620px; opacity: 0.75; pointer-events: none; animation: login-spin 260s linear infinite; }
.top-bar, .top-title { position: relative; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.top-bar { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; min-height: 68px; }
.brand { display: flex; align-items: center; color: #fff; text-decoration: none; }
.brand img { display: block; height: 26px; width: auto; }
.brand small { margin-left: 12px; font-weight: 400; font-size: 12px; letter-spacing: 0; color: #BFEDEF; }
nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
nav a { padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: #DCEAF6; text-decoration: none; transition: background-color 0.15s, color 0.15s; }
nav a:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
nav a.on { background: #fff; color: var(--navy); box-shadow: 0 6px 16px -8px rgba(10, 30, 60, 0.6); }
.who { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 14px; color: #E3ECF7; }
.who span { font-weight: 600; }
.who button.link { color: #BFEDEF; }
.who button.link:hover { color: #fff; }
.top-title { padding-top: 26px; }
.top-title h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; text-shadow: 0 2px 20px rgba(10, 30, 60, 0.35); }
.top-title h1::after { content: ""; display: block; width: 84px; height: 5px; margin-top: 14px; background: linear-gradient(90deg, var(--teal-bright), var(--teal)); }

/* ── 본문: 띠에 살짝 겹쳐 올라온 흰 판 ── */
main { position: relative; max-width: 1180px; margin: -52px auto 0; padding: 0 24px 72px; }
h2 { display: flex; align-items: center; gap: 10px; margin: 30px 0 12px; font-size: 17px; font-weight: 700; }
h2::before { content: ""; width: 6px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, var(--teal-bright), var(--teal)); }
.card { padding: 24px; border: 0; border-top: 4px solid transparent; border-radius: 16px;
  background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box;
  box-shadow: 0 18px 40px -26px rgba(23, 59, 107, 0.55), 0 1px 2px rgba(23, 59, 107, 0.08); }
.card + .card, .card + h2, h2 + .card { margin-top: 0; }
.card.narrow { max-width: 420px; display: grid; gap: 16px; }
.card h2:first-child { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; margin-bottom: 20px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--label); }
label small, .hint { display: block; margin-top: 4px; font-weight: 400; font-size: 12px; color: var(--sub); }
.opt { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--tint); font-weight: 600; font-size: 11px; color: var(--label); }
input:not([type=checkbox]), select { display: block; width: 100%; height: 46px; margin-top: 6px; padding: 0 12px; border: 1px solid #C5CFDA; border-radius: 10px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; transition: border-color 0.15s, box-shadow 0.15s; }
input:not([type=checkbox]):hover, select:hover { border-color: #8FB3C4; }
input:not([type=checkbox]):focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(55, 153, 162, 0.2); outline: none; }
input[type=checkbox] { accent-color: var(--navy); }
button:focus-visible, a:focus-visible, input[type=checkbox]:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
small.error { color: var(--error); font-weight: 600; }

/* 이수증 고르기: 고른 칸이 청록으로 켜진다 */
fieldset { margin: 0 0 22px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #F8FAFC; }
legend { padding: 0 8px; font-size: 14px; font-weight: 700; color: var(--navy); }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
label.check { display: flex; align-items: center; gap: 10px; min-height: 46px; font-size: 15px; font-weight: 500; color: var(--ink); cursor: pointer; }
label.check input { flex: none; width: 18px; height: 18px; margin: 0; }
.checks label.check { padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; }
.checks label.check:hover { border-color: #8FB3C4; }
.checks label.check:has(input:checked) { border-color: var(--teal); background: var(--tint); box-shadow: inset 0 0 0 1px var(--teal); font-weight: 600; color: #124B66; }
label.check.all { margin-bottom: 12px; padding: 0 4px 10px; border-bottom: 1px dashed #C5CFDA; font-weight: 700; color: var(--navy); }
label.check.contract { align-self: end; flex-wrap: wrap; min-height: 46px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; }
label.check.contract:has(input:checked) { border-color: var(--teal); background: var(--tint); }
label.check.contract small { flex-basis: 100%; margin: 0 0 0 28px; }

button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border: 1px solid #C5CFDA; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.button:hover, button:not(.primary):not(.link):hover { border-color: var(--teal); background: var(--tint); }
button.primary { min-width: 132px; border: 0; color: #fff; font-size: 16px; background: var(--grad); background-size: 180% 100%; background-position: 0 0; box-shadow: 0 10px 24px -10px rgba(30, 74, 128, 0.7); transition: background-position 0.35s ease, box-shadow 0.2s ease, transform 0.1s ease; }
button.primary:hover { background-position: 100% 0; box-shadow: 0 14px 28px -10px rgba(31, 111, 139, 0.75); }
button.primary:active { transform: translateY(1px); }
button:disabled, button.primary:disabled { background: #E3E9F0; color: var(--sub); box-shadow: none; cursor: not-allowed; }
button.link { min-height: 0; padding: 0; border: 0; border-radius: 4px; background: none; color: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
main button.link { color: var(--navy); }
main button.link:hover { color: var(--teal); }
.actions { display: flex; gap: 10px; margin-top: 20px; }
form.actions { margin-bottom: 0; }

.notice { margin: 0 0 14px; padding: 12px 16px; border-radius: 12px; background: #E3EEF9; font-weight: 500; box-shadow: 0 10px 24px -20px rgba(23, 59, 107, 0.8); }
.notice.error { background: #FCE4E2; color: var(--error); }
.notice.warn { background: var(--warn-bg); color: #6B4A00; }
.notice.ok { background: var(--ok-bg); color: #0E5A3A; }
.notice ul { margin: 6px 0 0; padding-left: 20px; font-weight: 400; }
.notice a { color: inherit; }
code { padding: 3px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); font: 700 17px/1.4 Consolas, monospace; letter-spacing: 0.04em; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 13px; font-weight: 600; color: var(--label); white-space: nowrap; }
table.files th { background: #F2F6FA; border-bottom-color: #C9D6E3; color: var(--navy); }
table.files th:first-child { border-radius: 10px 0 0 10px; }
table.files th:last-child { border-radius: 0 10px 10px 0; }
table.files tr:hover td { background: #F7FAFC; }
table.files tr:last-child td, table.summary tr:last-child th, table.summary tr:last-child td { border-bottom: 0; }
table.summary th { width: 128px; }
td.num { text-align: right; white-space: nowrap; }
td.row-actions { display: flex; gap: 14px; white-space: nowrap; }
td.row-actions form { margin: 0; }
td a { color: var(--navy); font-weight: 600; text-underline-offset: 3px; word-break: break-all; }
td a:hover { color: var(--teal); }
td small { color: var(--sub); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: #E8EDF3; color: #44505E; }
.badge.sent { background: #DDEBFA; color: #1A4A85; }
.badge.failed, .badge.bounced { background: #FCE4E2; color: var(--error); }
.badge.pending { background: var(--warn-bg); color: #6B4A00; }
.badge.read { background: var(--ok-bg); color: #0E5A3A; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 10px; }
.scroll { overflow-x: auto; padding: 12px 14px; }
/* 발송 기록 목록: 줄마다 한 줄로 읽히게 하고, 좁으면 옆으로 민다 */
.scroll th, .scroll td { white-space: nowrap; padding: 12px 10px; }
.scroll td a { word-break: normal; }
.scroll td small { display: block; margin-top: 2px; }
main > p.hint { margin: 14px 4px 8px; font-size: 13px; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .top { padding-bottom: 64px; }
  .top-title h1 { font-size: 26px; }
  .top-art { right: -260px; }
  main { margin-top: -44px; padding: 0 14px 56px; }
  .card { padding: 18px; }
  .grid, .checks { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .top-art { animation: none; } }

/* ── 로그인: 왼쪽은 증서의 얼굴(기요셰 무늬와 겹테두리), 오른쪽은 로그인 ── */
body.login { background: #fff; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr); min-height: 100vh; }
.login-hero { position: relative; overflow: hidden; padding: 28px; color: #fff;
  background:
    radial-gradient(120% 90% at 100% 100%, rgba(55, 153, 162, 0.95) 0%, rgba(55, 153, 162, 0) 60%),
    radial-gradient(90% 80% at 0% 0%, #2B2F7C 0%, rgba(43, 47, 124, 0) 65%),
    linear-gradient(160deg, #173B6B 0%, #1E4A80 45%, #1B6F86 100%); }
.login-rosette, .login-ring { position: absolute; right: -34%; bottom: -42%; width: min(124%, 1100px); opacity: 0.9; height: auto; aspect-ratio: 1; pointer-events: none; }
.login-rosette { animation: login-spin 260s linear infinite; }
.login-ring { animation: login-spin 340s linear infinite reverse; }
@keyframes login-spin { to { transform: rotate(360deg); } }
/* 증서의 겹테두리 */
.login-frame { position: relative; display: flex; flex-direction: column; justify-content: space-between; height: 100%; min-height: 520px; padding: 40px 44px;
  border: 1px solid rgba(255, 255, 255, 0.55); outline: 1px solid rgba(255, 255, 255, 0.22); outline-offset: 6px; }
.login-mark { display: block; align-self: flex-start; height: 44px; width: auto; }
.login-kind { margin: 0; font-size: 22px; font-weight: 600; color: #BFEDEF; }
.login-name { margin: 4px 0 0; font-size: clamp(44px, 5.6vw, 76px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; color: #fff; text-shadow: 0 2px 24px rgba(10, 30, 60, 0.35); }
.login-rule { width: 132px; height: 6px; margin: 26px 0 22px; background: linear-gradient(90deg, #7FE3E9, #3799A2); transform-origin: left center; animation: login-rule 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both; }
@keyframes login-rule { from { transform: scaleX(0); } }
.login-lead { margin: 0; font-size: 16px; line-height: 1.7; color: #DCEAF6; }
.login-site { display: flex; justify-content: space-between; gap: 16px; margin: 0; font-size: 13px; letter-spacing: 0.04em; color: rgba(227, 236, 247, 0.85); }
.login-site span:first-child { font-weight: 600; }

.login-panel { display: flex; align-items: center; justify-content: center; max-width: none; margin: 0; padding: 48px 32px; background: linear-gradient(180deg, #FFFFFF 0%, #F4F8FB 100%); }
.login-box { width: 100%; max-width: 360px; }
.login-logo { display: block; height: 48px; width: auto; margin-bottom: 44px; }
.login-box h1 { margin: 0 0 22px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.login-form label { margin: 16px 0 6px; font-size: 13px; font-weight: 600; color: var(--label); }
.login-form input { margin: 0; height: 52px; padding: 0 14px; font-size: 17px; border-color: #C5CFDA; border-radius: 10px; background: #fff; transition: border-color 0.15s, box-shadow 0.15s; }
.login-form input:hover { border-color: #8FB3C4; }
.login-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(55, 153, 162, 0.2); outline: none; }
.login-form button.primary { display: block; width: 100%; height: 54px; margin-top: 28px; border: 0; border-radius: 10px; font-size: 17px; color: #fff;
  background: linear-gradient(100deg, #1E4A80 0%, #1F6F8B 60%, #3799A2 100%); background-size: 180% 100%; background-position: 0 0;
  box-shadow: 0 10px 24px -10px rgba(30, 74, 128, 0.7); transition: background-position 0.35s ease, box-shadow 0.2s ease, transform 0.1s ease; }
.login-form button.primary:hover { background-position: 100% 0; box-shadow: 0 14px 28px -10px rgba(31, 111, 139, 0.75); }
.login-form button.primary:active { transform: translateY(1px); }
.login-box .notice { margin: 0 0 6px; }
.login-help { margin: 28px 0 0; font-size: 13px; line-height: 1.7; color: var(--sub); }

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; min-height: 0; }
  .login-hero { padding: 16px; }
  .login-frame { min-height: 0; height: auto; gap: 28px; padding: 24px 22px; }
  .login-kind { font-size: 17px; }
  .login-name { font-size: 40px; }
  .login-rule { margin: 16px 0 14px; }
  .login-lead { font-size: 14px; }
  .login-site { display: none; }
  .login-mark { height: 34px; }
  .login-rosette, .login-ring { right: -38%; bottom: -70%; width: 120%; }
  .login-panel { padding: 36px 24px 48px; }
  .login-logo { height: 40px; margin-bottom: 28px; }
}
@media (prefers-reduced-motion: reduce) { .login-rule, .login-rosette, .login-ring { animation: none; } }
