/* style.css — 슬로디스 포스트 앱 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #f7f8fa;
  --surface: #ffffff;
  --border:  #e0e3e8;
  --text:    #1a1d23;
  --muted:   #6b7280;
  --accent:  #4a7fe0;
  --accent-h:#2f5fbb;
  --danger:  #e05555;
  --success: #2d9e5f;
  --radius:  10px;
  --shadow:  0 1px 4px rgba(0,0,0,.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #111318;
    --surface: #1e2128;
    --border:  #2d3140;
    --text:    #e8eaf0;
    --muted:   #8b93a8;
    --shadow:  0 1px 4px rgba(0,0,0,.35);
  }
}

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── 헤더 ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow);
}

.header-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.02em;
}

.header-user {
  font-size: .8rem;
  color: var(--muted);
}

.header-user a {
  color: var(--accent);
  text-decoration: none;
}

.header-user a:hover { text-decoration: underline; }

/* ── 메인 ── */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}

/* ── 폼 필드 ── */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.field input[type="text"],
.field textarea,
.field select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: border-color .15s;
  appearance: none;
  -webkit-appearance: none;
}

.field textarea { resize: vertical; }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,127,224,.18);
}

.hint {
  margin-top: 8px;
  font-size: .82rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
}

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, opacity .15s;
}

.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  font-size: 1rem;
  padding: 13px 20px;
}

.btn-primary:hover:not(:disabled) { background: var(--accent-h); }

.btn-outline {
  background: var(--surface);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-outline:hover { background: var(--bg); }

.btn-google {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 12px 24px;
  font-size: 1rem;
  box-shadow: var(--shadow);
}

.btn-google:hover { background: var(--bg); }

/* ── 로그인 페이지 ── */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 36px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,.09);
}

.login-box h1 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.login-box .subtitle {
  color: var(--muted);
  margin-bottom: 32px;
  font-size: .9rem;
}

/* ── 사진 그리드 ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.photo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.photo-card .photo-footer {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .02em;
}

.badge-blur  { background: #fef3c7; color: #92400e; }
.badge-ok    { background: #d1fae5; color: #065f46; }
.badge-fail  { background: #fee2e2; color: #991b1b; }
.badge-none  { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

.photo-card .toggle-btn {
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  white-space: nowrap;
}

.photo-card .toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.photo-card .toggle-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── 진행 상태 ── */
.status-area {
  margin-top: 24px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.status-msg {
  font-size: .9rem;
  color: var(--muted);
}

/* ── 결과 영역 ── */
.result-area {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.result-area p { margin-bottom: 16px; font-weight: 600; color: var(--success); }

.result-area .btn { margin: 4px; }

/* ── 유틸 ── */
[hidden] { display: none !important; }

/* ── 모바일 ── */
@media (max-width: 480px) {
  .login-box { padding: 36px 20px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}
