@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap");

:root {
  --color-primary: #28558c;
  --color-primary-dark: #203f69;
  --color-primary-soft: #edf3f9;
  --color-text: #172033;
  --color-muted: #667085;
  --color-border: #e2e7ee;
  --color-surface: #fff;
  --color-background: #f4f6f9;
  --color-danger: #c52b26;
  --color-danger-dark: #a41f1b;
  --color-danger-soft: #fef2f2;
  --color-success: #087443;
  --color-success-soft: #ecfdf5;
  --color-warning: #925f00;
  --color-warning-soft: #fff7df;
  --shadow-panel: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-menu: 0 18px 42px rgba(16, 24, 40, .16);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --content-width: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; color: var(--color-text); font: 15px/1.6 "Noto Sans KR", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; margin: 0; background: var(--color-background); }
body, button, input, select, textarea { font: inherit; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
h1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.28; }
h2 { font-size: 21px; line-height: 1.4; }
h3 { font-size: 16px; line-height: 1.45; }
ul, ol { margin-top: 0; }
a { color: inherit; }
img, svg { max-width: 100%; }
img { height: auto; }
button { border: 0; }
button, a { touch-action: manipulation; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(40, 85, 140, .25); outline-offset: 2px; }
.u-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.muted, .text-muted, small { color: var(--color-muted); }
.pre-wrap { white-space: pre-wrap; }
.rich-text { overflow-wrap: anywhere; }

/* Shared controls */
input, select, textarea, .form-field-control, .admin-input {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); outline: 0; background: var(--color-surface); color: var(--color-text);
}
input:focus, select:focus, textarea:focus, .form-field-control:focus, .admin-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(40, 85, 140, .12); }
input:disabled, select:disabled, textarea:disabled { background: #f1f3f6; color: #98a2b3; cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; padding: 0; accent-color: var(--color-primary); }
textarea { min-height: 108px; resize: vertical; }
::placeholder { color: #98a2b3; }
label, .form-field-label { color: var(--color-text); font-size: 14px; font-weight: 700; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 8px; font-weight: 700; }
.form-required { color: var(--color-danger); }
.form-field, .auth-form, .admin-form, .event-form, .join-field-list { display: grid; gap: 8px; }
.form-field { margin-bottom: 16px; }
.form-field-help { color: var(--color-muted); font-size: 12px; font-weight: 400; }
.form-grid, .admin-grid, .metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-section + .form-section { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--color-border); }
.choice-group, .check-list { display: flex; flex-wrap: wrap; gap: 10px; }
.choice-group label, .check, .field-checkbox { display: flex; align-items: center; gap: 7px; }
.form-actions, .actions, .section-head, .card-header, .page-head, .contact-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-actions { flex-wrap: wrap; margin-top: 18px; }
.form-actions--end { justify-content: flex-end; }

.button, :where(button:not(.hamburger):not(.menu-close):not(.dialog-close)) {
  display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--color-border); border-radius: 8px;
  background: var(--color-surface); color: var(--color-text); cursor: pointer; font-weight: 700;
  line-height: 1.3; text-align: center; text-decoration: none;
}
.button:hover, :where(button:not(.hamburger):not(.menu-close):not(.dialog-close)):hover { background: #f7f9fb; }
.button:disabled, button:disabled { opacity: .5; cursor: not-allowed; }
.button.button--primary, button.button--primary, .button.button-primary, button.button-primary, .admin-button--primary { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.button.button--primary:hover, button.button--primary:hover, .button.button-primary:hover, button.button-primary:hover, .admin-button--primary:hover { border-color: var(--color-primary-dark); background: var(--color-primary-dark); }
.button--secondary { background: var(--color-surface); color: #344054; }
.button--danger, .button-danger { border-color: var(--color-danger); background: var(--color-danger); color: #fff; }
.button--danger:hover, .button-danger:hover { background: var(--color-danger-dark); }
.button--compact { min-height: 28px; padding: 4px 8px; border-radius: 6px; font-size: 12px; }

/* Shared surfaces */
.card, .panel, .auth-card, .account-delete, .contact-form-card, .admin-card {
  padding: clamp(20px, 3vw, 30px); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-panel);
}
.message, .status-message, .admin-notice { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 8px; background: #f7f9fb; }
.message-error, .status-message--error, .admin-notice--error, .is-error { border-color: #fecaca; background: var(--color-danger-soft); color: var(--color-danger); }
.message-success, .status-message--success, .is-success { border-color: #a7f3d0; background: var(--color-success-soft); color: var(--color-success); }
.message-warning, .is-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; background: var(--color-primary-soft); color: var(--color-primary); font-size: 12px; font-weight: 800; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
table, .data-table { width: 100%; border-collapse: collapse; }
.data-table { min-width: 760px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: middle; }
thead th { background: #f7f9fb; color: var(--color-muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; }
.table-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.table-actions form { display: inline-flex; align-items: center; gap: 5px; }
.table-actions select { width: auto; min-width: 76px; }
.pagination, .pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 20px; }

/* Shared dialog and editor */
.dialog { position: fixed; inset: 0; z-index: 1400; display: grid; place-items: center; padding: 20px; }
.dialog-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .52); }
.dialog-panel { position: relative; z-index: 1; width: min(720px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; background: var(--color-surface); box-shadow: 0 24px 70px rgba(15, 23, 42, .24); }
.dialog-panel > header, .dialog-panel > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; }
.dialog-panel > header { border-bottom: 1px solid var(--color-border); }
.dialog-panel > footer { justify-content: flex-end; border-top: 1px solid var(--color-border); }
.dialog-panel > section, .dialog-panel > form { min-height: 0; overflow: auto; }
.dialog-close { width: 42px; height: 42px; padding: 0; border-radius: 50%; background: #f7f9fb; color: #344054; cursor: pointer; font-size: 30px; line-height: 1; }
.mini-editor { width: 100%; overflow: hidden; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); }
.mini-editor-toolbar { display: flex; border-bottom: 1px solid var(--color-border); background: #f7f9fb; }
.mini-editor-button { width: 42px; min-height: 36px; padding: 0; border: 0; border-right: 1px solid var(--color-border); border-radius: 0; background: transparent; font-size: 17px; }
.mini-editor-surface { min-height: 180px; padding: 14px; outline: 0; overflow: auto; white-space: pre-wrap; }
.mini-editor-surface:empty::before { content: attr(data-placeholder); color: #98a2b3; }

/* Shared authentication */
.auth-shell { width: min(480px, 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; margin: auto; padding: 24px; }
.auth-shell-wide { width: min(560px, 100%); }
.auth-shell-account { width: min(820px, 100%); }
.auth-shell > section { width: 100%; }
.auth-logo, .auth-brand { display: flex; align-items: center; justify-content: center; margin-bottom: 12px; text-decoration: none; }
.auth-logo img, .auth-brand img { display: block; width: 142px; }
.auth-card > h1:not(.u-sr-only), .account-delete h1 { font-size: 21px; line-height: 1.35; text-align: center; }
.auth-card { padding: 32px; }
.auth-card > h1 + p { margin: 8px 0 24px; color: var(--color-muted); font-size: 16px; line-height: 1.5; text-align: center; }
.auth-form { width: 100%; display: block; }
.auth-form > .button--primary { width: 100%; min-height: 48px; font-size: 16px; }
.auth-form > .form-field-label { display: block; margin-bottom: 8px; }
.input-group { min-height: 48px; display: flex; align-items: center; border: 1px solid var(--color-border); border-radius: 8px; background: #fff; }
.auth-form > .input-group { margin-bottom: 16px; }
.input-group:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(40, 85, 140, .12); }
.input-group.is-invalid { border-color: #f0a8a5; box-shadow: none; }
.input-group.is-valid { border-color: #a7e7ca; box-shadow: none; }
.input-group input { height: 46px; min-width: 0; flex: 1; border: 0; box-shadow: none; }
.input-group-button { width: 46px; height: 46px; flex: none; padding: 0; border: 0; background: transparent; }
.auth-form > nav { display: grid; gap: 8px; margin-bottom: 24px; }
.auth-form > [role="separator"] { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; color: var(--color-muted); font-size: 14px; white-space: nowrap; }
.auth-form > [role="separator"]::before, .auth-form > [role="separator"]::after { width: 100%; height: 1px; background: var(--color-border); content: ""; }
.auth-social-button { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; color: var(--color-text); font-weight: 800; text-decoration: none; }
.auth-social-button:hover { background: #f7f9fb; }
.auth-social-mark { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.auth-social-mark img { width: 20px; }
.auth-password-icon { width: 20px; height: 20px; display: inline-flex; }
.auth-password-icon svg { width: 100%; height: 100%; }
.auth-password-icon-hide { display: none; }
.input-group-button.is-revealed .auth-password-icon-show { display: none; }
.input-group-button.is-revealed .auth-password-icon-hide { display: block; }
.auth-remember-row, .join-consent-row, .join-consent-all { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auth-remember-row { margin: 4px 0 24px; font-size: 14px; }
.auth-remember { display: flex; align-items: center; gap: 7px; }
.auth-find-link, .auth-signup-hint a, .recovery-login-link { color: #344054; font-weight: 700; text-decoration: underline; }
.auth-signup-hint { margin-top: 16px; color: var(--color-muted); text-align: center; }
.recovery-login-link { display: block; margin-top: 24px; font-size: 14px; text-align: center; }
.join-field-list { display: grid; gap: 12px; }
.join-field-list > div { min-width: 0; }
.join-consent { margin: 16px 0; overflow: hidden; border: 1px solid var(--color-border); border-radius: 10px; }
.join-consent-all, .join-consent-row { padding: 12px 14px; }
.join-consent-all { background: #f7f9fb; }
.join-consent-row { border-top: 1px solid var(--color-border); }
.join-field-feedback { min-height: 17px; margin-top: 4px; color: var(--color-muted); font-size: 12px; line-height: 1.4; }
.join-field-feedback.is-success { color: var(--color-success); }
.join-field-feedback.is-error { color: var(--color-danger); }
.join-field-feedback.is-success:not(:empty)::before { content: "✓ "; font-weight: 800; }
.join-field-feedback.is-error:not(:empty)::before { content: "! "; font-weight: 800; }
.join-password-guide { margin-left: 8px; color: var(--color-muted); font-size: 11px; font-weight: 400; }

/* Shared event flyer */
.media-frame, .media-cover { display: block; width: 100%; object-fit: cover; border-radius: 10px; }
.media-frame--contain { object-fit: contain; }
.media-frame--cover { aspect-ratio: 16 / 9; }
.flyer { position: relative; width: 100%; max-width: 980px; margin: 0 auto 40px; }
.flyer > article { display: grid; grid-template-columns: 300px 1fr; min-height: 800px; overflow: hidden; background: #fff; }
.flyer-sidebar { position: relative; min-height: 800px; background: #cfc7b6; }
.flyer-sidebar-top { position: absolute; inset: 0; overflow: hidden; }
.flyer-cover-img { width: 100%; height: 100%; border-radius: 0; object-fit: cover; }
.flyer-sidebar-mark { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; color: #fff; font-size: 34px; font-weight: 800; }
.flyer-sidebar-bottom, .flyer-poster-brand { display: none; }
.flyer-status { position: absolute; z-index: 3; top: 22px; left: 22px; min-height: 30px; display: inline-flex; align-items: center; padding: 5px 13px; border-radius: 999px; background: #3d8862; color: #fff; font-size: 12px; font-weight: 800; line-height: 1.2; }
.flyer-main { position: relative; display: flex; min-height: 800px; flex-direction: column; padding: 70px 50px 0; }
.flyer-main > header { position: absolute; inset: 0 0 auto; }
.flyer-brand { position: absolute; top: 20px; right: 24px; width: auto; height: 32px; }
.flyer-main > h1 { margin-bottom: 18px; color: #374151; font-size: 24px; font-weight: 800; line-height: 1.28; overflow-wrap: anywhere; }
.flyer-meta, .flyer-main > address { display: flex; align-items: center; gap: 8px; color: #374151; font-style: normal; font-weight: 700; }
.flyer-meta { margin-bottom: 4px; }
.flyer-main > address { margin-bottom: 12px; }
.flyer-meta-icon { width: 16px; height: 16px; flex: none; color: var(--color-muted); }
.flyer-meta-text, .flyer-place { min-width: 0; overflow-wrap: anywhere; }
.flyer-place { color: var(--color-muted); }
.flyer-place-actions, .flyer-actions { display: flex; align-items: center; gap: 8px; }
.flyer-place-actions, .flyer-calendar-action { margin-left: auto; }
.flyer :is(.flyer-calendar-action, .flyer-place-action) { min-height: 22px; height: 22px; padding: 0 6px; border-radius: 6px; color: #8490a3; font-size: 10px; font-weight: 600; white-space: nowrap; }
.flyer-main > .flyer-actions { margin: 4px 0 16px; padding-bottom: 14px; border-bottom: 1px solid #edf0f4; }
.flyer-main > .flyer-actions:has(+ .flyer-partners) { margin-bottom: 0; }
.flyer-main > .flyer-actions .flyer-register { min-height: 40px; padding: 0 20px; }
.flyer-main > .flyer-actions .flyer-register:first-child { min-width: 210px; padding-inline: 30px; }
.flyer-partners { min-height: 52px; display: flex; align-items: center; gap: 18px; padding: 10px 0; border-bottom: 1px solid #edf0f4; }
.flyer-partners > h2 { width: 58px; flex: none; color: var(--color-muted); font-size: 10px; }
.flyer-partner-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.flyer-partner-logos img { width: auto; max-width: 104px; height: 24px; }
.flyer-description-section { flex: 1; }
.flyer-description { min-height: 220px; margin: 24px 0; color: #374151; line-height: 1.6; overflow-wrap: anywhere; }
.flyer-description.is-collapsed { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 9; }
.flyer-description-toggle, .flyer-attachments-toggle { min-height: 28px; display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--color-muted); font-size: 11px; font-weight: 700; }
.flyer-description-toggle::after, .flyer-attachments-toggle::after { content: "▾"; font-size: 12px; transition: transform .16s ease; }
.flyer-description-toggle[aria-expanded="true"]::after, .flyer-attachments-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
.flyer-main > .flyer-block { margin-top: 20px; }
.flyer-main :is(.flyer-block, .flyer-attachments) > h2 { margin-bottom: 8px; color: #344f7c; font-size: inherit; font-weight: 800; }
.flyer-section-list { padding-left: 18px; }
.flyer-attendee-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.flyer-attendee-avatars { display: flex; padding-left: 8px; }
.flyer-attendee-avatar { width: 34px; height: 34px; display: grid; place-items: center; margin-left: -8px; border: 2px solid #fff; border-radius: 50%; background: #dfe7f2; color: #344f7c; font-size: 12px; font-weight: 800; }
.flyer-attachments { min-width: 0; margin-top: 32px; }
.flyer-attachments .flyer-section-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; padding: 0; list-style: none; }
.flyer-attach-item { min-height: 26px; display: flex; min-width: 0; align-items: center; gap: 5px; padding: 4px 2px; border-bottom: 1px solid #edf0f4; font-size: 11px; }
.flyer-attach-item::before { content: "↧"; flex: none; color: #344f7c; font-size: 10px; font-weight: 800; }
.flyer-attach-item a { min-width: 0; overflow: hidden; color: var(--color-text); font-weight: 600; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.flyer-attach-item a:hover { text-decoration: underline; text-underline-offset: 2px; }
.flyer-attach-item .text-muted { flex: none; margin-left: auto; font-size: 9px; }
.flyer-attach-item.is-hidden { display: none; }
.flyer-main > footer { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding: 12px 0; border-top: 1px solid #d8dde3; color: var(--color-muted); font-size: 12px; }
.flyer-main > footer nav { display: flex; gap: 8px; }
.flyer[data-page-template="poster"] > article { display: block; min-height: 0; }
.flyer[data-page-template="poster"] .flyer-sidebar { min-height: 0; aspect-ratio: 21 / 9; }
.flyer[data-page-template="poster"] .flyer-poster-brand { position: absolute; z-index: 2; top: 22px; right: 26px; display: block; width: auto; height: 32px; }
.flyer[data-page-template="poster"] .flyer-main { min-height: 540px; padding: 42px 56px 0; }
.flyer[data-page-template="poster"] .flyer-main > header { display: none; }
.flyer[data-page-template="poster"] .flyer-main > h1 { max-width: 760px; font-size: 28px; line-height: 1.3; }
.flyer--public { margin-bottom: 0; }
.flyer--public .flyer-description { min-height: 0; }
.flyer--public .flyer-description.is-collapsed { display: block; max-height: 14.4em; }

.doc-wrap { width: min(860px, calc(100% - 40px)); margin: 48px auto; }
.doc-head { margin-bottom: 28px; }
.doc-meta { margin-top: 8px; color: var(--color-muted); }
.doc-body { padding: clamp(22px, 4vw, 42px); border: 1px solid var(--color-border); border-radius: 16px; background: #fff; }
.doc-body h2 { margin: 30px 0 10px; }
.doc-body h2:first-child { margin-top: 0; }

@media (max-width: 760px) {
  .form-grid, .admin-grid, .metric-grid { grid-template-columns: 1fr; }
  .section-head, .page-head { align-items: stretch; flex-direction: column; }
  .form-actions, .actions { flex-wrap: wrap; }
  .dialog { padding: 10px; }
  .dialog-panel { max-height: calc(100dvh - 20px); }
  .auth-shell { padding: 18px 12px; }
  .auth-card { padding: 24px 20px; }
  .flyer > article { display: block; min-height: 0; }
  .flyer-sidebar { min-height: 0; padding: 24px 24px 0; background: #fff; }
  .flyer-sidebar-top { position: relative; max-width: 360px; height: clamp(156px, 48vw, 200px); margin: auto; border-radius: 10px; }
  .flyer-main { min-height: 0; padding: 24px 24px 0; }
  .flyer-main > header { display: none; }
  .flyer-main > h1 { font-size: 24px; }
  .flyer-meta, .flyer-main > address { flex-wrap: wrap; }
  .flyer-place-actions { margin-left: 0; }
  .flyer-actions { flex-direction: column; }
  .flyer-actions .button { width: 100%; }
  .flyer-description { min-height: 0; }
  .flyer-attachments .flyer-section-list { grid-template-columns: 1fr; }
  .flyer-main > footer { align-items: flex-start; flex-direction: column; margin-top: 24px; }
}
