/*
 * 지니PDF light theme.
 *
 * The upstream BentoPDF markup is written for a dark UI (bg-gray-900 page,
 * bg-gray-800 cards, text-white headings). Instead of editing ~120 pages we
 * remap the Tailwind v4 colour variables here so the same classes render a
 * light, high-contrast UI. These declarations are unlayered, so they win over
 * Tailwind's `@layer theme` / `@layer utilities` rules.
 *
 * New 지니PDF markup (navbar, footer, content pages) must NOT rely on gray
 * utilities; it uses the `gp-*` classes at the bottom of this file.
 */

:root {
  /* Brand */
  --gp-brand: #2563eb;
  --gp-brand-hover: #1d4ed8;
  --gp-brand-soft: #eff6ff;
  --gp-ink: #111827;
  --gp-text: #374151;
  --gp-muted: #4b5563;
  --gp-subtle: #6b7280;
  --gp-line: #e5e7eb;
  --gp-line-strong: #d1d5db;
  --gp-page: #f5f6f8;
  --gp-surface: #ffffff;

  /* Gray scale, flipped (dark UI classes -> light surfaces, light text -> dark text) */
  --color-gray-50: #111827;
  --color-gray-100: #1f2937;
  --color-gray-200: #1f2937;
  --color-gray-300: #374151;
  --color-gray-400: #4b5563;
  --color-gray-500: #6b7280;
  --color-gray-600: #d1d5db;
  --color-gray-700: #e5e7eb;
  --color-gray-800: #ffffff;
  --color-gray-900: #f5f6f8;
  --color-gray-950: #eef0f3;

  /* Indigo accent -> 지니PDF blue. 500-700 stay saturated for white-on-colour buttons. */
  --color-indigo-50: #172554;
  --color-indigo-100: #1e3a8a;
  --color-indigo-200: #1e40af;
  --color-indigo-300: #1d4ed8;
  --color-indigo-400: #2563eb;
  --color-indigo-500: #3b82f6;
  --color-indigo-600: #2563eb;
  --color-indigo-700: #1d4ed8;
  --color-indigo-800: #bfdbfe;
  --color-indigo-900: #dbeafe;
  --color-indigo-950: #eff6ff;

  --color-blue-50: #172554;
  --color-blue-100: #1e3a8a;
  --color-blue-200: #1e40af;
  --color-blue-300: #1d4ed8;
  --color-blue-400: #2563eb;
  --color-blue-800: #bfdbfe;
  --color-blue-900: #dbeafe;
  --color-blue-950: #eff6ff;

  --color-purple-300: #7e22ce;
  --color-purple-400: #9333ea;
  --color-purple-900: #f3e8ff;
  --color-violet-300: #6d28d9;
  --color-violet-400: #7c3aed;
  --color-violet-900: #ede9fe;

  --color-red-50: #450a0a;
  --color-red-100: #7f1d1d;
  --color-red-200: #991b1b;
  --color-red-300: #b91c1c;
  --color-red-400: #dc2626;
  --color-red-800: #fecaca;
  --color-red-900: #fee2e2;
  --color-red-950: #fef2f2;

  --color-green-100: #14532d;
  --color-green-200: #166534;
  --color-green-300: #15803d;
  --color-green-400: #16a34a;
  --color-green-800: #bbf7d0;
  --color-green-900: #dcfce7;
  --color-green-950: #f0fdf4;

  --color-emerald-200: #065f46;
  --color-emerald-300: #047857;
  --color-emerald-400: #059669;
  --color-emerald-900: #d1fae5;

  --color-yellow-100: #713f12;
  --color-yellow-200: #713f12;
  --color-yellow-300: #854d0e;
  --color-yellow-400: #a16207;
  --color-yellow-800: #fef08a;
  --color-yellow-900: #fef9c3;
  --color-yellow-950: #fefce8;

  --color-amber-200: #92400e;
  --color-amber-300: #b45309;
  --color-amber-400: #d97706;
  --color-amber-900: #fef3c7;

  --color-orange-300: #c2410c;
  --color-orange-400: #ea580c;
  --color-orange-900: #ffedd5;

  --font-sans:
    'Pretendard', -apple-system, BlinkMacSystemFont, system-ui,
    'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', 'DM Sans',
    sans-serif;
}

/* Inputs with no background class sit on the browser's white default; keep
   the original (light-UI) gray scale for them so their text stays dark. */
input:not([class*='bg-']),
textarea:not([class*='bg-']),
select:not([class*='bg-']) {
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  --color-gray-300: #d1d5db;
  --color-gray-200: #e5e7eb;
}

html,
body {
  background-color: var(--gp-page);
}

body {
  color: var(--gp-text);
  font-family: var(--font-sans);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* Headings and labels written as text-white on dark cards -> dark ink. */
.text-white {
  color: var(--gp-ink);
}

/* ...except where white text genuinely sits on a coloured fill. */
:is(
    .bg-indigo-500,
    .bg-indigo-600,
    .bg-indigo-700,
    .bg-blue-500,
    .bg-blue-600,
    .bg-blue-700,
    .bg-red-500,
    .bg-red-600,
    .bg-red-700,
    .bg-green-500,
    .bg-green-600,
    .bg-green-700,
    .bg-emerald-500,
    .bg-emerald-600,
    .bg-emerald-700,
    .bg-purple-500,
    .bg-purple-600,
    .bg-purple-700,
    .bg-violet-500,
    .bg-violet-600,
    .bg-orange-500,
    .bg-orange-600,
    .bg-amber-500,
    .bg-amber-600,
    .bg-yellow-500,
    .bg-yellow-600,
    .bg-pink-500,
    .bg-pink-600,
    .bg-teal-500,
    .bg-teal-600,
    .bg-cyan-500,
    .bg-cyan-600,
    .btn-gradient,
    .cta-button,
    .gp-btn-primary
  ).text-white,
:is(
    .bg-indigo-500,
    .bg-indigo-600,
    .bg-indigo-700,
    .bg-blue-500,
    .bg-blue-600,
    .bg-blue-700,
    .bg-red-500,
    .bg-red-600,
    .bg-red-700,
    .bg-green-500,
    .bg-green-600,
    .bg-green-700,
    .bg-emerald-600,
    .bg-purple-600,
    .bg-violet-600,
    .bg-orange-500,
    .bg-orange-600,
    .btn-gradient,
    .cta-button,
    .gp-btn-primary
  )
  .text-white {
  color: #ffffff;
}

.hover\:text-white:hover {
  color: var(--gp-ink);
}

:is(
    .hover\:bg-indigo-500,
    .hover\:bg-indigo-600,
    .hover\:bg-indigo-700,
    .hover\:bg-blue-600,
    .hover\:bg-blue-700,
    .hover\:bg-red-600,
    .hover\:bg-red-700,
    .hover\:bg-green-600,
    .hover\:bg-green-700
  ).hover\:text-white:hover {
  color: #ffffff;
}

/* Modal backdrops stay dark and translucent. */
.bg-black.bg-opacity-75 {
  background-color: rgb(17 24 39 / 0.55);
}

/* --- Upstream component classes with hard-coded dark colours --- */

.tool-card {
  background-color: var(--gp-surface);
  border: 1px solid var(--gp-line);
  box-shadow: 0 1px 2px rgb(17 24 39 / 0.04);
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--gp-brand);
  box-shadow: 0 6px 16px rgb(17 24 39 / 0.08);
}

.category-header {
  color: var(--gp-ink);
}

.category-header:hover,
.category-header:hover .category-chevron {
  color: var(--gp-brand);
}

::-webkit-scrollbar-track {
  background: #eef0f3;
}

::-webkit-scrollbar-thumb {
  background: #c3c9d2;
}

::-webkit-scrollbar-thumb:hover {
  background: #9aa3af;
}

.sortable-ghost {
  border-color: var(--gp-brand);
}

.pill {
  background-color: #eef0f3;
  color: var(--gp-text);
}

.cta-button {
  background-color: var(--gp-brand);
}

.cta-button:hover {
  background-color: var(--gp-brand-hover);
}

.feature-card,
.testimonial-card {
  background-color: var(--gp-surface);
  border-color: var(--gp-line);
}

.section-divider {
  background: var(--gp-line);
}

.btn-gradient {
  background-image: none;
  background-color: var(--gp-brand);
  color: #ffffff;
  border-radius: 0.5rem;
}

.btn-gradient:hover {
  background-color: var(--gp-brand-hover);
  box-shadow: none;
}

.btn-gradient:focus {
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 4px var(--gp-brand);
}

.btn-gradient:disabled,
.btn-gradient[disabled] {
  background-color: #9aa3af;
}

.loader,
.spinner {
  border-color: var(--gp-line);
  border-bottom-color: var(--gp-brand);
}

.saved-signature.selected {
  border-color: var(--gp-brand);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.2);
}

.faq-item.open .faq-question {
  color: var(--gp-brand);
}

.legal-content h2,
.legal-content h3 {
  color: var(--gp-ink);
}

.legal-content p,
.legal-content ul,
.legal-content ol {
  color: var(--gp-text);
}

.legal-content a {
  color: var(--gp-brand);
}

.legal-content a:hover {
  color: var(--gp-brand-hover);
}

kbd,
.kbd {
  color: var(--gp-ink);
  background-color: #f3f4f6;
  border-color: var(--gp-line-strong);
  box-shadow: 0 1px 0 0 var(--gp-line-strong);
}

#shortcuts-list::-webkit-scrollbar-track {
  background: #eef0f3;
}

#shortcuts-list::-webkit-scrollbar-thumb {
  background: #c3c9d2;
}

#tool-interface {
  color: var(--gp-text);
}

/* ---------------------------------------------------------------------- */
/* 지니PDF components (explicit colours, independent of the remap above)   */
/* ---------------------------------------------------------------------- */

.gp-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--gp-line);
}

.gp-nav a.gp-nav-link {
  color: var(--gp-text);
  font-weight: 500;
  font-size: 0.95rem;
}

.gp-nav a.gp-nav-link:hover {
  color: var(--gp-brand);
}

.gp-brand-text {
  color: var(--gp-ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gp-brand-text b {
  color: var(--gp-brand);
  font-weight: 800;
}

.gp-mobile-menu {
  background: #ffffff;
  border-top: 1px solid var(--gp-line);
}

.gp-mobile-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--gp-text);
  font-weight: 500;
  border-radius: 0.375rem;
}

.gp-mobile-menu a:hover {
  background: var(--gp-brand-soft);
  color: var(--gp-brand);
}

.gp-icon-btn {
  color: var(--gp-muted);
  border-radius: 0.375rem;
}

.gp-icon-btn:hover {
  color: var(--gp-ink);
  background: #f3f4f6;
}

.gp-footer {
  margin-top: 4rem;
  background: #ffffff;
  border-top: 1px solid var(--gp-line);
  color: var(--gp-muted);
  font-size: 0.9rem;
}

.gp-footer h3 {
  color: var(--gp-ink);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.gp-footer a {
  color: var(--gp-muted);
}

.gp-footer a:hover {
  color: var(--gp-brand);
  text-decoration: underline;
}

.gp-footer .gp-footer-note {
  color: var(--gp-subtle);
  font-size: 0.8rem;
  line-height: 1.6;
}

.gp-section-title {
  color: var(--gp-ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gp-lead {
  color: var(--gp-muted);
  line-height: 1.7;
}

.gp-card {
  background: #ffffff;
  border: 1px solid var(--gp-line);
  border-radius: 0.75rem;
}

.gp-card h3 {
  color: var(--gp-ink);
  font-weight: 700;
}

.gp-card p {
  color: var(--gp-muted);
  line-height: 1.65;
}

.gp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--gp-brand-soft);
  color: var(--gp-brand-hover);
  font-size: 0.85rem;
  font-weight: 600;
}

.gp-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  background: var(--gp-brand);
  color: #ffffff;
  font-weight: 700;
}

.gp-btn-primary:hover {
  background: var(--gp-brand-hover);
  color: #ffffff;
}

.gp-link {
  color: var(--gp-brand);
  font-weight: 600;
}

.gp-link:hover {
  color: var(--gp-brand-hover);
  text-decoration: underline;
}

/* Step list used in tool guides */
.gp-steps {
  counter-reset: gp-step;
}

.gp-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gp-line);
}

.gp-step:last-child {
  border-bottom: 0;
}

.gp-step-num {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--gp-brand);
  color: #ffffff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.gp-step h3 {
  color: var(--gp-ink);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.gp-step p {
  color: var(--gp-muted);
  line-height: 1.65;
}

.gp-faq details {
  background: #ffffff;
  border: 1px solid var(--gp-line);
  border-radius: 0.625rem;
  padding: 1rem 1.25rem;
}

.gp-faq details + details {
  margin-top: 0.75rem;
}

.gp-faq summary {
  cursor: pointer;
  color: var(--gp-ink);
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.gp-faq summary::-webkit-details-marker {
  display: none;
}

.gp-faq summary::after {
  content: '+';
  color: var(--gp-subtle);
  font-weight: 400;
}

.gp-faq details[open] summary::after {
  content: '−';
}

.gp-faq details p {
  margin-top: 0.75rem;
  color: var(--gp-muted);
  line-height: 1.7;
}

.gp-related a {
  display: block;
  background: #ffffff;
  border: 1px solid var(--gp-line);
  border-radius: 0.625rem;
  padding: 0.875rem 1rem;
}

.gp-related a:hover {
  border-color: var(--gp-brand);
}

.gp-related a strong {
  display: block;
  color: var(--gp-ink);
  font-weight: 700;
  margin-bottom: 0.125rem;
}

.gp-related a span {
  color: var(--gp-subtle);
  font-size: 0.85rem;
  line-height: 1.5;
}

.gp-prose {
  color: var(--gp-text);
  line-height: 1.8;
}

.gp-prose h1 {
  color: var(--gp-ink);
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.gp-prose h2 {
  color: var(--gp-ink);
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

.gp-prose h3 {
  color: var(--gp-ink);
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.gp-prose p {
  margin-bottom: 0.9rem;
}

.gp-prose ul,
.gp-prose ol {
  margin: 0 0 1rem 1.25rem;
}

.gp-prose ul {
  list-style: disc;
}

.gp-prose ol {
  list-style: decimal;
}

.gp-prose li {
  margin-bottom: 0.35rem;
}

.gp-prose a {
  color: var(--gp-brand);
  text-decoration: underline;
}

.gp-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1.25rem;
  font-size: 0.925rem;
}

.gp-prose th,
.gp-prose td {
  border: 1px solid var(--gp-line-strong);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.gp-prose th {
  background: #f3f4f6;
  color: var(--gp-ink);
  font-weight: 700;
}

.gp-prose .gp-meta {
  color: var(--gp-subtle);
  font-size: 0.9rem;
}

/* Ad slots: collapsed until an ad is actually filled. */
.gp-ad {
  display: none;
}

.gp-ad.gp-ad-on {
  display: block;
  max-width: 970px;
  margin: 2.5rem auto;
  padding: 0 1rem;
  text-align: center;
}

.gp-ad-label {
  display: none;
  color: #9aa3af;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

/* Ad labels: shown for filled slots only (AdSense reports fill state on the <ins>). */
.gp-ad.gp-ad-on .gp-ad-label {
  display: block;
}

.gp-ad.gp-ad-on:has(ins.adsbygoogle:not([data-ad-status='filled'])) .gp-ad-label {
  display: none;
}

.gp-ad.gp-ad-on:has(ins.adsbygoogle[data-ad-status='unfilled']) {
  display: none;
}

.gp-ad-disclosure {
  color: #9aa3af;
  font-size: 0.72rem;
  margin-top: 0.35rem;
}

.gp-coupang iframe {
  max-width: 100%;
}

/* First-party promotion (지니소프트 services) */
.gp-ad.gp-ad-house {
  text-align: left;
}

.gp-house {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #ffffff;
  border: 1px solid var(--gp-line);
  border-left: 4px solid var(--gp-brand);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
}

.gp-house-label {
  display: block;
  color: var(--gp-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.gp-house strong {
  display: block;
  color: var(--gp-ink);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.gp-house p {
  color: var(--gp-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 0.2rem;
}

.gp-house-cta {
  flex: 0 0 auto;
  background: var(--gp-brand);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 1.1rem;
  border-radius: 0.5rem;
  white-space: nowrap;
}

.gp-house-cta:hover {
  background: var(--gp-brand-hover);
  color: #ffffff;
}

@media (max-width: 640px) {
  .gp-house {
    flex-direction: column;
    align-items: stretch;
  }

  .gp-house-cta {
    text-align: center;
  }
}

/* Upload hint lines wrap on phones; keep them centred like the icon above. */
#drop-zone p {
  text-align: center;
}
