@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Noto+Sans+KR:wght@400;500;700&display=swap");

:root {
  --bg: #090d16;
  --card: #121a2b;
  --text: #f3f7ff;
  --muted: #a8b3c9;
  --primary: #4b8dff;
  --primary-dark: #2f72ea;
  --border: #24304a;
  --ok-bg: #0d3324;
  --ok-text: #87f7bd;
  --warn-bg: #382c10;
  --warn-text: #ffce71;
  --err-bg: #3a1c1f;
  --err-text: #ff9ca3;
}

* {
  box-sizing: border-box;
}

html {
  background: #090d16;
}

body {
  position: relative;
  margin: 0;
  min-height: 100dvh;
  background-color: #090d16;
  background: radial-gradient(circle at 20% 0%, #17233d 0%, #0b1220 45%, var(--bg) 100%);
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Noto Sans KR", "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -10%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(700px 380px at 8% 8%, rgba(70, 130, 255, 0.14), transparent 65%),
    radial-gradient(760px 420px at 88% 12%, rgba(70, 130, 255, 0.1), transparent 70%),
    radial-gradient(900px 500px at 45% 90%, rgba(92, 59, 198, 0.14), transparent 65%);
  filter: blur(8px);
}

body > * {
  position: relative;
  z-index: 1;
}

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  background: rgba(10, 16, 30, 0.86);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(2, 6, 14, 0.35);
  z-index: 100;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar {
    background: rgba(10, 16, 30, 0.97);
  }
}

.topbar-inner {
  min-height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  text-decoration: none;
  color: #dce8ff;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #dce8ff 0%, #78a6ff 75%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu {
  display: flex;
  gap: 16px;
  align-items: center;
}

.menu a,
.link-btn {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.menu a:hover,
.link-btn:hover {
  color: var(--primary);
}

.inline-form {
  margin: 0;
}

.main-content {
  padding: 42px 0 72px;
}

.hero {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  text-align: center;
  gap: 22px;
}

.hero-video-wrap {
  width: min(920px, 95%);
  margin-top: 8px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(102, 149, 255, 0.35);
  box-shadow:
    0 18px 42px rgba(8, 16, 34, 0.55),
    0 0 0 1px rgba(76, 129, 251, 0.15) inset;
  background: #0c1017;
}

.hero-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  margin: 0 auto;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
  text-shadow: 0 12px 30px rgba(40, 95, 220, 0.24);
}

.lead {
  color: #c4d2eb;
  max-width: 780px;
  line-height: 1.65;
  margin: 0;
}

.badge {
  margin: 0;
  background: rgba(75, 141, 255, 0.18);
  color: var(--primary);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 14px 30px rgba(5, 10, 20, 0.45);
  backdrop-filter: blur(6px);
  margin-bottom: 18px;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .card {
    background: #111a2c;
  }
}

.auth-card {
  max-width: 560px;
  margin: 20px auto;
}

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

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.narrow {
  max-width: 520px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid #2e3b56;
  background: #0f1728;
  border-radius: 10px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

select {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid #2e3b56;
  background: #0f1728;
  border-radius: 10px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

select option {
  background: #0f1728;
  color: var(--text);
}

textarea {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid #2e3b56;
  background: #0f1728;
  color: var(--text);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #0f1728 inset;
  transition: background-color 9999s ease-out 0s;
}

select:focus {
  border-color: var(--primary);
  outline: 3px solid #dce9ff;
}

input:focus {
  border-color: var(--primary);
  outline: 3px solid #dce9ff;
}

.btn {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 10px;
  min-height: 44px;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #4b8dff 0%, #2f72ea 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(28, 92, 230, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5c9aff 0%, #3a7af0 100%);
  transform: translateY(-1px);
}

.btn-xl {
  min-height: 54px;
  padding: 0 28px;
  font-size: 1.05rem;
}

.btn-disabled {
  background: #22324f;
  color: #9eb2d1;
  cursor: not-allowed;
}

.alert {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.alert-success {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.alert-warn {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.alert-error {
  background: var(--err-bg);
  color: var(--err-text);
}

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

.list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 10px 8px;
}

.table th {
  color: #d7e2f7;
  background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:hover {
  background: rgba(98, 140, 232, 0.08);
}

.table a,
.table a:visited {
  color: #9fc0ff;
  text-decoration: none;
}

.table a:hover {
  color: #c3d8ff;
  text-decoration: underline;
}

.payment-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.bank-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  background: #0f1728;
}

.must-apply-box {
  border: 1px solid rgba(110, 159, 255, 0.6);
  background: linear-gradient(180deg, rgba(28, 63, 123, 0.5) 0%, rgba(14, 32, 63, 0.55) 100%);
  border-radius: 14px;
  padding: 14px;
  margin: 10px 0 14px;
  box-shadow: 0 12px 26px rgba(14, 29, 56, 0.45);
}

.must-apply-title {
  margin: 0 0 6px;
  font-weight: 800;
  color: #dbe9ff;
}

.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 8, 20, 0.72);
  backdrop-filter: blur(4px);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .app-modal-overlay {
    background: rgba(3, 8, 20, 0.88);
  }
}

.app-modal {
  width: min(520px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(110, 159, 255, 0.45);
  background: linear-gradient(180deg, #16253f 0%, #0f1728 100%);
  box-shadow: 0 24px 50px rgba(2, 8, 24, 0.6);
  padding: 22px;
}

.app-modal h3 {
  margin: 0 0 10px;
}

.app-modal p {
  margin: 0 0 10px;
}

.app-modal .btn {
  margin-top: 8px;
  width: 100%;
}

.hidden {
  display: none !important;
}

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

.admin-head h1 {
  margin: 0;
  font-size: 1.5rem;
}

.admin-menu {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-logout-btn {
  min-height: 44px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  margin-bottom: 0;
  background: linear-gradient(180deg, #132039 0%, #121a2b 100%);
}

.stat-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.admin-filter {
  display: flex;
  gap: 10px;
}

.admin-filter input {
  flex: 1;
}

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

.inline-action {
  display: flex;
  gap: 6px;
}

.inline-action input {
  width: 90px;
  min-height: 40px;
}

.status {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-pending {
  background: #4a3a11;
  color: #ffcf70;
}

.status-approved {
  background: #143a2b;
  color: #89f4bf;
}

.status-rejected {
  background: #4a2228;
  color: #ff9ea5;
}

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

.product-card {
  border: 1px solid var(--border);
  background: #101a2d;
  border-radius: 14px;
  padding: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(110, 159, 255, 0.55);
  box-shadow: 0 12px 24px rgba(9, 24, 54, 0.35);
}

.product-card-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(75, 141, 255, 0.25) inset;
}

.product-card h3 {
  margin: 0 0 10px;
}

.product-price {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
}

.product-price span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-filter {
    flex-direction: column;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    width: min(100%, 94%);
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }

  .main-content {
    padding: 22px 0 48px;
  }

  .topbar-inner {
    min-height: 62px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
  }

  .menu {
    width: 100%;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .card {
    padding: 16px;
    border-radius: 14px;
  }

  .hero {
    min-height: auto;
    gap: 16px;
  }

  .hero h1 {
    font-size: clamp(1.7rem, 7vw, 2.2rem);
  }

  .lead {
    font-size: 0.94rem;
    line-height: 1.55;
  }

  .btn,
  .payment-grid .btn,
  .row-actions .btn {
    width: 100%;
  }

  .payment-grid,
  .row-actions {
    flex-direction: column;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .table th,
  .table td {
    font-size: 0.88rem;
    padding: 8px 6px;
  }

  .app-modal {
    padding: 16px;
  }

  .app-modal h3 {
    font-size: 1.05rem;
  }
}
