/* ============================================
   OTJ (오팀장) Website - Main Stylesheet
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navy: #0f172a;
  --navy-light: #1e293b;
  --navy-lighter: #334155;
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --blue-light: #60a5fa;
  --white: #ffffff;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --font: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1200px;
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

/* --- Utility --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--navy-lighter);
}
.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-400);
  padding: 8px 16px;
}
.btn-ghost:hover {
  color: var(--white);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.125rem;
  border-radius: 12px;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.875rem;
  border-radius: 8px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9375rem;
  color: var(--gray-400);
  transition: color var(--transition);
}
.nav-links a:hover {
  color: var(--white);
}

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  padding: 4px;
}

/* --- Hero --- */
.hero {
  padding: 160px 0 120px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue-light);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero h1 .accent {
  color: var(--blue);
}

.hero p {
  font-size: clamp(1.1rem, 2.5vw, 1.375rem);
  color: var(--gray-400);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Section common --- */
.section {
  padding: 100px 0;
}

.section-dark {
  background: var(--navy-light);
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
}

.section-title h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-title p {
  color: var(--gray-400);
  font-size: 1.125rem;
  max-width: 560px;
  margin: 0 auto;
}

/* --- How it Works --- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.step {
  text-align: center;
  padding: 40px 24px;
  border-radius: 16px;
  background: var(--navy);
  border: 1px solid var(--navy-lighter);
  transition: border-color var(--transition);
}
.step:hover {
  border-color: var(--blue);
}

.step-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: rgba(59, 130, 246, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.step-number {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 28px;
  margin-bottom: 12px;
}

.step h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step p {
  color: var(--gray-400);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* --- Features --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 36px;
  border-radius: 16px;
  background: var(--navy-light);
  border: 1px solid var(--navy-lighter);
  transition: border-color var(--transition), transform var(--transition);
}
.feature-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--gray-400);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* --- Pricing --- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

.pricing-card {
  border-radius: 16px;
  background: var(--navy);
  border: 1px solid var(--navy-lighter);
  padding: 36px;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition);
}
.pricing-card:hover {
  transform: translateY(-2px);
}

.pricing-card.featured {
  border-color: var(--blue);
  position: relative;
}

.pricing-card.featured::before {
  content: '인기';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 600;
}

.pricing-grade {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blue-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.pricing-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.pricing-price {
  font-size: 2rem;
  font-weight: 800;
  margin: 16px 0 4px;
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--gray-400);
}

.pricing-note {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-bottom: 24px;
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: 28px;
}

.pricing-features li {
  padding: 8px 0;
  font-size: 0.9375rem;
  color: var(--gray-300);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}

.pricing-card .btn {
  width: 100%;
}

/* --- Download --- */
.download-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.download-card {
  padding: 36px;
  border-radius: 16px;
  background: var(--navy-light);
  border: 1px solid var(--navy-lighter);
  text-align: center;
}

.download-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.download-card p {
  color: var(--gray-400);
  font-size: 0.9375rem;
  margin-bottom: 20px;
}

.download-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Footer --- */
.footer {
  padding: 60px 0 40px;
  border-top: 1px solid var(--navy-lighter);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 40px;
}

.footer-brand {
  flex-shrink: 0;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 8px;
}

.footer-brand p {
  color: var(--gray-500);
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 48px;
}

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-300);
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  color: var(--gray-500);
  font-size: 0.875rem;
  transition: color var(--transition);
}
.footer-col a:hover {
  color: var(--white);
}

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--navy-lighter);
  text-align: center;
  color: var(--gray-500);
  font-size: 0.8125rem;
}

/* --- Auth Page --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--navy-light);
  border: 1px solid var(--navy-lighter);
  border-radius: 20px;
  padding: 48px 36px;
  text-align: center;
}

.auth-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-card .subtitle {
  color: var(--gray-400);
  margin-bottom: 32px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--gray-500);
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--navy-lighter);
}

.btn-oauth {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  transition: all var(--transition);
}

.btn-google {
  background: var(--white);
  color: #333;
}
.btn-google:hover {
  background: var(--gray-200);
}

.btn-apple {
  background: #333;
  color: var(--white);
  border: 1px solid var(--navy-lighter);
}
.btn-apple:hover {
  background: #444;
}

/* --- Dashboard --- */
.dashboard {
  padding-top: 80px;
  min-height: 100vh;
}

.dashboard-header {
  padding: 40px 0 20px;
}

.dashboard-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.dashboard-header p {
  color: var(--gray-400);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 28px;
  border-radius: 16px;
  background: var(--navy-light);
  border: 1px solid var(--navy-lighter);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
}

.stat-value.balance {
  color: var(--green);
}

.stat-unit {
  font-size: 1rem;
  font-weight: 400;
  color: var(--gray-400);
  margin-left: 4px;
}

/* Usage Table */
.usage-section {
  margin-bottom: 40px;
}

.usage-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--navy-light);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--navy-lighter);
}

.usage-table th,
.usage-table td {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.9375rem;
}

.usage-table th {
  background: var(--navy-lighter);
  color: var(--gray-300);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.usage-table td {
  border-top: 1px solid var(--navy-lighter);
  color: var(--gray-300);
}

.usage-table tr:hover td {
  background: rgba(59, 130, 246, 0.04);
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--gray-500);
}

/* Grade Selector */
.grade-section {
  margin-bottom: 40px;
}

.grade-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.grade-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grade-option {
  padding: 24px;
  border-radius: 12px;
  background: var(--navy-light);
  border: 2px solid var(--navy-lighter);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.grade-option:hover {
  border-color: var(--blue);
}
.grade-option.active {
  border-color: var(--blue);
  background: rgba(59, 130, 246, 0.08);
}

.grade-option h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.grade-option p {
  color: var(--gray-400);
  font-size: 0.8125rem;
}

/* --- Charge Page --- */
.charge-page {
  padding-top: 80px;
  min-height: 100vh;
}

.charge-header {
  padding: 40px 0 20px;
}

.charge-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.charge-header p {
  color: var(--gray-400);
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 600px;
  margin-bottom: 32px;
}

.amount-option {
  padding: 24px;
  border-radius: 12px;
  background: var(--navy-light);
  border: 2px solid var(--navy-lighter);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.amount-option:hover {
  border-color: var(--blue);
}
.amount-option.selected {
  border-color: var(--blue);
  background: rgba(59, 130, 246, 0.08);
}

.amount-option .amount {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.amount-option .desc {
  font-size: 0.8125rem;
  color: var(--gray-400);
}

.charge-summary {
  max-width: 600px;
  padding: 28px;
  border-radius: 12px;
  background: var(--navy-light);
  border: 1px solid var(--navy-lighter);
  margin-bottom: 24px;
}

.charge-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9375rem;
  color: var(--gray-300);
}

.charge-row.total {
  border-top: 1px solid var(--navy-lighter);
  margin-top: 8px;
  padding-top: 16px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
}

/* --- Legal Pages --- */
.legal-page {
  padding: 100px 0 60px;
  min-height: 100vh;
}

.legal-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 32px;
}

.legal-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--gray-200);
}

.legal-page p,
.legal-page li {
  color: var(--gray-400);
  font-size: 0.9375rem;
  line-height: 1.8;
  margin-bottom: 12px;
}

.legal-page ul {
  padding-left: 24px;
}

.legal-page .updated {
  color: var(--gray-500);
  font-size: 0.8125rem;
  margin-bottom: 40px;
}

/* --- Loading / Toast --- */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--navy-lighter);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success {
  background: var(--green);
  color: var(--white);
}
.toast.error {
  background: var(--red);
  color: var(--white);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .grade-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--navy);
    border-bottom: 1px solid var(--navy-lighter);
    padding: 16px 24px;
    gap: 16px;
  }
  .hero {
    padding: 120px 0 80px;
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .download-grid {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    flex-direction: column;
  }
  .footer-links {
    flex-direction: column;
    gap: 24px;
  }
  .amount-grid {
    grid-template-columns: 1fr;
  }
  .usage-table {
    font-size: 0.8125rem;
  }
  .usage-table th,
  .usage-table td {
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  .auth-card {
    padding: 36px 24px;
  }
}
