/* 첫 화면 — 학급포털과 같은 디자인 */
:root {
  color-scheme: light;
  --paper: #f6f7f5; --white: #fff; --ink: #172522; --muted: #596762; --line: #e0e6e1; --field: #ccd6d0; --hover: #91b5a6;
  --brand: #206756; --brand-hover: #174f42; --dark: #143f38; --soft: #e9f3ee; --accent-line: #cce1d6;
  --amber: #8a5a12; --amber-soft: #fbf4e4; --amber-line: #eedcb3; --red: #922f24; --red-soft: #f9edeb;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 "Pretendard Variable", "Pretendard", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
a { color: var(--brand); text-decoration: none; }
[hidden] { display: none !important; }
h1, h2 { letter-spacing: -.05em; line-height: 1.25; margin: 0; }
.spacer { flex: 1; }

.top { position: sticky; top: 0; z-index: 4; background: var(--white); border-bottom: 1px solid var(--line); }
.topIn { max-width: 1180px; margin: auto; height: 68px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 17px; letter-spacing: -.04em; line-height: 1.2; }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 650; letter-spacing: .02em; margin-top: 3px; }
.mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; }
.topAct { display: flex; align-items: center; gap: 8px; }
.who { font-size: 13.5px; font-weight: 700; color: var(--muted); margin-right: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 15px; border-radius: 9px; border: 1px solid transparent; font-weight: 700; font-size: 14px; white-space: nowrap; }
.btn.small { min-height: 38px; padding: 6px 11px; font-size: 13px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.secondary { background: var(--white); border-color: var(--line); color: var(--ink); }
.btn.secondary:hover { background: var(--soft); border-color: var(--hover); }
.btn.danger { background: var(--white); border-color: #e8bfbb; color: #9d352c; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }

/* 로그인 전 */
.landing { max-width: 1180px; margin: auto; padding: 56px 24px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 420px); gap: 48px; align-items: start; }
.eyebrow { font-size: 13px; color: var(--brand); font-weight: 750; margin: 0 0 8px; }
.hero h1 { font-size: clamp(32px, 4.4vw, 50px); letter-spacing: -.065em; }
.feat { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 12px; }
.feat li { background: var(--white); border: 1px solid var(--line); border-radius: 15px; padding: 16px 18px; display: grid; gap: 2px; }
.feat b { font-size: 16px; letter-spacing: -.03em; }
.feat span { color: var(--muted); font-size: 14px; }
.authCard { background: var(--white); border: 1px solid var(--line); border-radius: 17px; padding: 22px; position: sticky; top: 92px; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tabs button { flex: 1; min-height: 40px; border: 1px solid var(--line); background: var(--white); border-radius: 9px; font-weight: 700; color: var(--muted); }
.tabs .active { color: var(--brand); background: var(--soft); border-color: var(--accent-line); }
.form { display: grid; }
.form.pad { padding: 4px 22px 18px; }
.field { display: grid; gap: 6px; margin: 11px 0 3px; }
.field > span { font-size: 14px; font-weight: 700; }
.field input { width: 100%; min-height: 45px; border: 1px solid var(--field); border-radius: 9px; background: #fff; padding: 9px 11px; color: var(--ink); }
.field input::placeholder { color: var(--muted); opacity: .85; }
.form .btn.wide { margin-top: 16px; }
.error { padding: 10px 12px; border-radius: 9px; background: var(--red-soft); color: var(--red); margin-top: 12px; font-size: 14px; }
.note { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* 내 공연 */
.dash { max-width: 1180px; margin: auto; padding: 28px 24px 60px; display: grid; gap: 18px; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; min-height: 70px; }
.heading h2 { font-size: 28px; }
.legacy { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: 15px; padding: 16px 18px; }
.legacy b { display: block; letter-spacing: -.03em; }
.legacy span { color: var(--amber); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 15px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 17px; padding: 20px; display: grid; gap: 12px; min-width: 0; }
.card h3 { margin: 0; font-size: 19px; letter-spacing: -.045em; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 100px; font-size: 12px; font-weight: 750; background: var(--soft); color: var(--brand); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.links { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.linkRow { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.linkRow span { font-weight: 700; min-width: 82px; }
.linkRow code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: inherit; font-size: 12.5px; }
.cardAct { display: flex; gap: 8px; }
.cardAct .btn.primary { flex: 1; }
.empty { background: var(--white); border: 1px dashed var(--field); border-radius: 17px; padding: 34px; text-align: center; display: grid; gap: 4px; }
.empty span { color: var(--muted); }

/* 대화상자 */
.dlg { border: 1px solid var(--line); border-radius: 20px; padding: 0; width: min(640px, 94vw); box-shadow: 0 24px 60px #162e2433; color: var(--ink); }
.dlg.small { width: min(440px, 94vw); }
.dlg::backdrop { background: rgba(20, 40, 34, .35); }
.dlgHead { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dlgHead b { font-size: 18px; letter-spacing: -.045em; }
.x { width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 17px; }
.x:hover { background: var(--paper); }
.dlgFoot { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }
.dlgFootIn { display: flex; gap: 8px; margin-top: 16px; }
.checkbox { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 650; color: var(--muted); }
.checkbox input { width: 17px; height: 17px; accent-color: var(--brand); }
.guide { list-style: none; counter-reset: g; margin: 0; padding: 16px 22px; display: grid; gap: 10px; }
.guide li { counter-increment: g; position: relative; padding: 12px 14px 12px 52px; border-radius: 13px; background: var(--paper); display: grid; gap: 2px; }
.guide li::before { content: counter(g); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 8px; background: var(--white); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--brand); }
.guide li b { letter-spacing: -.03em; }
.guide li span { color: var(--muted); font-size: 14px; }
.guide em { font-style: normal; font-weight: 750; color: var(--ink); }
.guide li.must { background: var(--amber-soft); border: 1px solid var(--amber-line); }
.guide li.must::before { background: #d49a2a; color: #fff; border-color: #d49a2a; }
.guide li.share { background: var(--soft); border: 1px solid var(--accent-line); }
.guide li.share::before { background: var(--brand); color: #fff; border-color: var(--brand); }

.toast { position: fixed; z-index: 8; right: 24px; bottom: 24px; max-width: calc(100% - 48px); border-radius: 12px; padding: 12px 18px; background: var(--dark); color: #fff; box-shadow: 0 8px 30px #122d2550; }

@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; padding: 28px 16px; gap: 24px; }
  .authCard { position: static; }
  .topIn { padding: 0 16px; }
  .who { display: none; }
  .dash { padding: 20px 16px 48px; }
  .legacy { flex-direction: column; align-items: stretch; }
}
.card > *, .links, .linkRow { min-width: 0; }
.linkRow .btn { flex: none; }

/* 찾기 · 복구 코드 · 계정 */
.linkBtn { margin-top: 12px; background: none; border: 0; color: var(--muted); font-size: 13.5px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; justify-self: center; }
.linkBtn:hover { color: var(--brand); }
.pad2 { padding: 16px 22px 20px; }
.result { margin-top: 12px; padding: 12px 14px; border-radius: 9px; background: var(--soft); color: var(--brand); font-weight: 700; }
.rcInfo { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.rcCode { font-size: 28px; font-weight: 800; letter-spacing: .08em; text-align: center; padding: 18px; border-radius: 13px; background: var(--paper); border: 1px dashed var(--field); font-variant-numeric: tabular-nums; user-select: all; }
.row2 { display: flex; gap: 8px; margin-top: 12px; }
.row2 .btn { flex: 1; }
.form h4 { margin: 0 0 2px; font-size: 16px; letter-spacing: -.035em; }
.form.sep { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

@media (max-width: 620px) {
  .topIn { height: auto; min-height: 60px; padding: 10px 14px; flex-wrap: wrap; row-gap: 8px; }
  .brand small { display: none; }
  .brand { font-size: 16px; }
  .mark { width: 34px; height: 34px; }
  .topAct { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .topAct .btn.small { min-height: 36px; padding: 5px 10px; font-size: 13px; }
  .heading { flex-wrap: wrap; align-items: center; min-height: 0; }
}
