/* 두온 단축URL 공용 스타일 */
:root {
  --brand: #0f766e;        /* teal-700 */
  --brand-dark: #115e59;
  --brand-soft: #ccfbf1;
  --accent: #b45309;       /* amber-700 */
  --text: #1f2937;
  --text-sub: #4b5563;
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --danger: #b91c1c;
  --ok: #15803d;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 6px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #134e4a;
  outline-offset: 2px;
}

/* 레이아웃 */
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 60px; gap: 12px;
}
.logo { font-weight: 800; font-size: 1.15rem; color: var(--brand-dark); text-decoration: none; }
.logo span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 600; padding: 8px 10px; border-radius: 8px; }
.nav a:hover { background: var(--brand-soft); }
.nav .user-name { color: var(--text-sub); font-size: .92rem; }

main.wrap { padding: 28px 20px 60px; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--text-sub);
  font-size: .88rem;
  padding: 22px 0 34px;
  background: var(--card);
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: var(--text-sub); }

/* 카드/섹션 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 22px;
}
.card h2 { margin: 0 0 14px; font-size: 1.2rem; }

.hero { text-align: center; padding: 34px 0 8px; }
.hero h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0 0 10px; }
.hero p { color: var(--text-sub); margin: 0 0 22px; }

/* 폼 */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .95rem; }
.field .hint { font-size: .84rem; color: var(--text-sub); margin-top: 4px; }
input[type="text"], input[type="url"], input[type="date"], input[type="password"], select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus { border-color: var(--brand); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 180px; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-size: 1rem; font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-outline { background: #fff; border-color: var(--brand); color: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--text-sub); border-color: var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 소셜 로그인 버튼 */
.social-btns { display: grid; gap: 12px; max-width: 360px; margin: 0 auto; }
.btn-google { background: #fff; border-color: #cbd5e1; color: #1f2937; }
.btn-kakao { background: #fee500; color: #191919; }
.btn-naver { background: #03c75a; color: #fff; }

/* 결과 카드 */
.result-short {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--brand-soft);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.result-short strong { font-size: 1.12rem; word-break: break-all; }
.qr-box { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.qr-preview { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.qr-opts { flex: 1; min-width: 220px; }
.color-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.color-row input[type="color"] { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }

/* 테이블 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f1f5f9; font-size: .86rem; white-space: nowrap; }
td .code-link { font-weight: 700; }
td .sub { color: var(--text-sub); font-size: .84rem; word-break: break-all; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.badge-ok { background: #dcfce7; color: var(--ok); }
.badge-warn { background: #fef3c7; color: var(--accent); }
.badge-danger { background: #fee2e2; color: var(--danger); }
.badge-muted { background: #e2e8f0; color: var(--text-sub); }

/* 통계 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat-card .num { font-size: 1.5rem; font-weight: 800; color: var(--brand-dark); }
.stat-card .lbl { font-size: .84rem; color: var(--text-sub); }

/* 모달 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 50;
}
.modal {
  background: var(--card); border-radius: var(--radius);
  max-width: 560px; width: 100%; max-height: 90svh; overflow-y: auto;
  padding: 24px;
}
.modal h3 { margin: 0 0 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
[hidden] { display: none !important; }

/* 탭 */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button {
  min-height: 42px; padding: 8px 16px;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; font-weight: 700; cursor: pointer; color: var(--text-sub);
}
.tabs button[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 알림 */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #134e4a; color: #fff;
  padding: 12px 22px; border-radius: 99px;
  font-weight: 700; box-shadow: var(--shadow); z-index: 99;
}
.msg-error { color: var(--danger); font-weight: 700; margin: 8px 0; }
.msg-ok { color: var(--ok); font-weight: 700; margin: 8px 0; }

/* 404/센터 페이지 */
.center-page { display: flex; align-items: center; justify-content: center; min-height: 100svh; padding: 20px; }
.notfound-card { text-align: center; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 44px 36px; max-width: 460px; }
.notfound-mark { font-size: 3rem; font-weight: 900; color: var(--brand-soft); margin: 0; -webkit-text-stroke: 2px var(--brand); }
.notfound-card h1 { font-size: 1.3rem; margin: 8px 0; }
.notfound-card p { color: var(--text-sub); }

/* 접근성 유틸 */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 560px) {
  .card { padding: 18px; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }
}
