/*
 * 공통 스타일: 기본 글꼴과 색상 변수, HTML 요소, 로고, 버튼, 입력창, 대화상자.
 * 화면 배치: main.css / 테마와 효과: theme.css / 개별 기능: 각 기능의 CSS.
 * HTML에서 base → main → theme → 기능별 CSS 순서로 불러옵니다.
 */

:root {
  color-scheme: light;
  --bg: #f6f5f0;
  --ink: #283e35;
  --muted: #626f65;
  --line: #d9ded2;
  --accent: #dce7bc;
  --paper: #fffef9;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

button:disabled {
  opacity: 0.4;
  cursor: default;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #738e48;
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

header,
footer {
  margin: auto;
  padding: 28px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header {
  border-bottom: 1px solid var(--line);
}

.logo {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
}

.logo img {
  display: block;
  width: clamp(80px, 12vw, 104px);
  height: auto;
  opacity: 0;
}

.logo::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--desk-accent, #ffb020);
  -webkit-mask: url("../images/logo-nodi-main.png") center / contain no-repeat;
  mask: url("../images/logo-nodi-main.png") center / contain no-repeat;
  pointer-events: none;
}

input:not([type="checkbox"]):not([type="file"]):not([type="radio"]),
textarea {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 13px 14px;
  border-radius: 8px;
  width: 100%;
  min-width: 0;
}

.quiet,
.file-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 16px;
  font-size: 12px;
  background: transparent;
}

.primary {
  background: var(--ink);
  color: white;
  border-radius: 8px;
  padding: 16px 23px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 30px;
}

.primary:hover {
  background: #3d5748;
}

.hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}

.text-button {
  font-size: 12px;
  padding: 12px 0;
  color: var(--muted);
}

footer {
  font-size: 10px;
  color: var(--muted);
  padding-bottom: 30px;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  color: var(--ink);
  padding: 30px;
  width: min(490px, calc(100% - 28px));
  max-height: 85dvh;
  overflow: auto;
}

dialog::backdrop {
  background: #23382d55;
  backdrop-filter: blur(3px);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.dialog-head h2,
dialog h2 {
  font-size: 21px;
  font-weight: 500;
  margin: 0;
}

.dialog-head button {
  font-size: 25px;
  padding: 7px;
}

dialog label {
  display: block;
  font-size: 12px;
  margin: 14px 0;
}

dialog label input {
  margin-top: 8px;
}

dialog .check {
  display: flex;
  gap: 10px;
  align-items: center;
}

dialog .check input {
  margin: 0;
}

dialog textarea {
  height: 125px;
  resize: vertical;
  margin-bottom: 15px;
}

dialog hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 25px 0;
}

dialog h3 {
  font-size: 14px;
}

dialog .primary {
  padding: 13px 20px;
}

.backup-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.file-button {
  position: relative;
  cursor: pointer;
  margin: 0;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer;
}

.file-button:focus-within {
  outline: 3px solid #738e48;
}

.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.skip:focus {
  display: block;
  padding: 10px;
}

@media (max-width: 700px) {
  header,
  footer {
    padding: 22px;
  }

  dialog {
    padding: 22px;
  }

  .primary,
  .quiet {
    min-height: 44px;
  }
}

header,
footer {
  max-width: 880px;
  padding: 22px 32px;
}

header {
  border: 0;
  gap: 20px;
}

.logo {
  font-size: 32px;
}

.header-date {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.primary {
  min-height: 48px;
  justify-content: center;
}

.primary:disabled {
  background: #dfe3d8;
  color: #596451;
  opacity: 1;
}

.primary:disabled:hover {
  background: #dfe3d8;
}

.quiet:hover:not(:disabled),
.text-button:hover {
  background: #e9eddf;
}

.text-button {
  border-radius: 5px;
  padding: 12px 8px;
}

footer {
  max-width: 800px;
  padding-top: 22px;
}

@media (max-width: 700px) {
  header {
    padding: 18px 20px;
    gap: 14px;
  }

  .logo {
    font-size: 29px;
  }

  .header-date {
    font-size: 11px;
  }

  footer {
    padding: 20px;
  }
}

@media (max-width: 360px) {
  .header-date {
    font-size: 10px;
  }

  header {
    gap: 9px;
  }
}
