/* file: public/css/style.css */

:root {
  --bg: #fbf8f3;
  --bg-soft: #fdf1e3;
  --card: #ffffff;
  --card-soft: rgba(255, 255, 255, 0.86);
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --brand: #f97316;
  --brand-soft: rgba(249, 115, 22, 0.10);
  --brand-soft-strong: rgba(249, 115, 22, 0.16);
  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.12);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.10);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.12);
  --shadow-sm: 0 8px 24px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 16px 48px rgba(17, 24, 39, 0.09);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(251, 146, 60, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.08), transparent 28%),
    linear-gradient(180deg, #fff8f1 0%, #fbf8f3 38%, #ffffff 100%);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP",
    "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic",
    "Meiryo", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.login-page {
  min-height: 100vh;
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.shell-header-inner {
  min-height: 92px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.app-shell {
  padding-top: 28px;
  padding-bottom: 56px;
}

.eyebrow,
.section-label,
.hero-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.page-title {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.page-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 760px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 22px;
}

.hero-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #fffaf5);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-value {
  display: block;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.panel-span-12 { grid-column: span 12; }
.panel-span-8  { grid-column: span 8; }
.panel-span-7  { grid-column: span 7; }
.panel-span-6  { grid-column: span 6; }
.panel-span-5  { grid-column: span 5; }
.panel-span-4  { grid-column: span 4; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.panel-head-wrap {
  flex-wrap: wrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  width: min(520px, 100%);
}

.card h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

.card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.login-shell {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.login-title {
  margin: 0 0 32px;
  text-align: center;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.login-card {
  padding: 40px 32px;
}

.login-form-stack {
  display: grid;
  gap: 16px;
}

.login-submit {
  width: 100%;
}

.editor-status-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.05), rgba(255, 255, 255, 0.95));
}

.editor-status-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.editor-status-card p {
  margin: 0;
}

.editor-status-meta {
  white-space: nowrap;
}

.form-feedback {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
}

.form-feedback.info,
.form-feedback.success,
.form-feedback.error {
  display: block;
}

.form-feedback.info {
  color: #9a3412;
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.16);
}

.form-feedback.success {
  color: #065f46;
  background: rgba(5, 150, 105, 0.10);
  border-color: rgba(5, 150, 105, 0.18);
}

.form-feedback.error {
  color: #991b1b;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.15);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #9ca3af;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(249, 115, 22, 0.35);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.10);
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #1f2937;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.06);
  text-decoration: none;
}

.btn.primary {
  background: linear-gradient(180deg, #fb923c, #f97316);
  color: #ffffff;
  border-color: transparent;
}

.btn.primary:hover {
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.22);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.72);
}

.btn.danger {
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #ffffff;
  border-color: transparent;
}

.btn.danger:hover {
  box-shadow: 0 14px 28px rgba(220, 38, 38, 0.22);
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.error {
  color: var(--danger);
  margin-top: 12px;
  min-height: 1.2em;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: #ffffff;
}

.data-table th,
.data-table td {
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.data-table th {
  background: #fffaf5;
  color: #374151;
  font-size: 13px;
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.clickable-row {
  cursor: pointer;
  transition: background 120ms ease;
}

.clickable-row:hover {
  background: rgba(249, 115, 22, 0.045);
}

.clickable-row.is-selected {
  background: rgba(249, 115, 22, 0.08);
}

.cell-title {
  font-weight: 800;
  color: #111827;
}

.cell-note {
  color: #4b5563;
  max-width: 260px;
}

.empty-cell {
  text-align: center !important;
  color: var(--muted);
  padding: 28px !important;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill-open {
  color: #9a3412;
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.20);
}

.pill-close {
  color: #991b1b;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.12);
}

.pill-neutral {
  color: #334155;
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.08);
}

.stack-list {
  display: grid;
  gap: 12px;
}

.soft-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,250,245,0.98));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.soft-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.soft-card p {
  margin: 8px 0 0;
}

.muted {
  color: var(--muted);
}

.info-block-grid,
.summary-card-grid,
.placeholder-grid {
  display: grid;
  gap: 14px;
}

.info-block-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.placeholder-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.placeholder-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(249, 115, 22, 0.24);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.04), rgba(255, 255, 255, 0.95));
}

.placeholder-card strong {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
}

.placeholder-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.callout-panel {
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.07), rgba(255, 255, 255, 0.94));
  border: 1px solid rgba(249, 115, 22, 0.14);
}

.callout-panel h3 {
  margin: 0 0 8px;
}

.callout-panel p {
  margin: 0;
  color: #4b5563;
}

.summary-value {
  margin: 10px 0 4px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-span-2 {
  grid-column: span 2;
}

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

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

.login-shell-wide {
  max-width: 980px;
}

.login-title-single {
  white-space: nowrap;
  font-size: clamp(36px, 5.2vw, 72px);
}

.editor-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.field-hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* app specific additions */

.beer-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.beer-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,250,245,0.98));
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.beer-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(249, 115, 22, 0.18);
  text-decoration: none;
}

.beer-card-image-wrap {
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, #fff7ed, #ffffff);
  overflow: hidden;
}

.beer-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.beer-card-body {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.beer-card-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  color: var(--text);
}

.beer-card-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.beer-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.beer-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

.beer-detail-image {
  width: 100%;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  background: #fff;
}

.detail-meta-list {
  display: grid;
  gap: 12px;
}

.detail-meta-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.9);
}

.detail-meta-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid rgba(249, 115, 22, 0.15);
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.preview-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.preview-card-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fffaf5;
  font-size: 13px;
  font-weight: 800;
}

.preview-card-body {
  padding: 14px;
}

.preview-card img {
  border-radius: 14px;
  border: 1px solid var(--line);
}

.preview-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 28px;
  border-radius: 18px;
  border: 1px dashed rgba(249, 115, 22, 0.22);
  background: linear-gradient(180deg, rgba(249,115,22,0.04), rgba(255,255,255,0.96));
  color: var(--muted);
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.kv-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
}

.kv-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

.gacha-result-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 1080px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .panel-span-8,
  .panel-span-7,
  .panel-span-6,
  .panel-span-5,
  .panel-span-4 {
    grid-column: span 12;
  }

  .summary-card-grid,
  .placeholder-grid,
  .info-block-grid,
  .beer-card-grid,
  .beer-detail-grid,
  .gacha-result-card,
  .kv-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 16px;
  }

  .shell-header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-panel,
  .panel,
  .card,
  .login-card {
    padding: 18px;
  }

  .login-title {
    margin-bottom: 24px;
    font-size: clamp(32px, 9vw, 52px);
    text-align: center;
  }

  .login-submit {
    width: 100%;
  }

  .editor-status-card {
    flex-direction: column;
  }

  .editor-status-meta {
    white-space: normal;
  }

  .form-grid,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .form-span-2 {
    grid-column: span 1;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .metric-value {
    font-size: 24px;
  }

  .login-title-single {
    white-space: normal;
  }

  .editor-guide-grid {
    grid-template-columns: 1fr;
  }
}
