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

:root {
  --blue: #1e40af;
  --blue-mid: #2563eb;
  --blue-light: #dbeafe;
  --blue-tag: #eff6ff;
  --blue-tag-text: #1d4ed8;
  --text-dark: #111827;
  --text-muted: #6b7280;
  --bg: #f0f4ff;
  --bg-hero: linear-gradient(135deg, #e8eeff 0%, #f5f7ff 60%, #eef2ff 100%);
  --border: #e5e7eb;
  --white: #ffffff;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f8faff;
  color: var(--text-dark);
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}

.nav-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-brand-text {
  line-height: 1.2;
}

.nav-brand-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: 0.02em;
}

.nav-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

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

.nav-links a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  transition: color .15s;
}

.nav-links a:hover {
  color: var(--blue-mid);
}

.btn-login {
  background: var(--blue-mid);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}

.btn-login:hover {
  background: var(--blue);
}

/* ── HERO ── */
.hero {
  background: var(--bg-hero);
  padding: 80px 48px 100px;
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
}

.hero-inner {
  max-width: 1200px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 60px;
}

.hero-content {
  flex: 1.4;
}

.hero-image {
  flex: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image img {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.eyebrow {
  display: inline-block;
  background: var(--blue-tag);
  color: var(--blue-tag-text);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.08;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero-desc {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 660px;
  margin-bottom: 32px;
}

.hashtag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.hashtag {
  background: var(--blue-tag);
  color: var(--blue-tag-text);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
}

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--blue-mid);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  background: var(--blue);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--blue-mid);
  border: 1.5px solid var(--blue-mid);
  border-radius: 8px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
  text-decoration: none;
  display: inline-block;
}

.btn-outline:hover {
  background: var(--blue-mid);
  color: #fff;
  transform: translateY(-1px);
}

/* ── SERVICES ── */
.services {
  padding: 100px 48px;
  background: #fff;
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
}

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

.section-tag {
  display: inline-block;
  background: var(--blue-tag);
  color: var(--blue-tag-text);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.service-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

.service-card:hover {
  border-color: var(--blue-mid);
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.1);
  transform: translateY(-4px);
}

.service-icon {
  width: 56px;
  height: 56px;
  background: var(--blue-tag);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-mid);
  margin-bottom: 20px;
}

.service-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.service-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ── FOOTER ── */
.footer {
  background: var(--text-dark);
  color: #fff;
  padding: 80px 48px 32px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  margin-bottom: 60px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
}

.footer-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer-brand-text {
  line-height: 1.4;
}

.footer-brand-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
}

.footer-brand-sub {
  font-size: 13px;
  color: #9ca3af;
  font-weight: 400;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer-link-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
}

.footer-link-list {
  list-style: none;
}

.footer-link-list li {
  margin-bottom: 12px;
}

.footer-link-list a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 14px;
  transition: color .15s;
}

.footer-link-list a:hover {
  color: #fff;
}

.footer-link-list li:not(:has(a)) {
  color: #9ca3af;
  font-size: 14px;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 32px;
}

.footer-copyright {
  font-size: 14px;
  color: #9ca3af;
}

/* ── MODAL ── */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

.modal-content-large {
  max-width: 600px;
}

@media (min-width: 768px) {
  .modal-content-large {
    max-width: 700px;
  }
}

@media (min-width: 1024px) {
  .modal-content-large {
    max-width: 800px;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.modal-close:hover {
  background: #e5e7eb;
  color: #374151;
}

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

@media (max-width: 640px) {
  .login-card {
    padding: 32px 24px 24px;
  }
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form-feedback {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 14px;
  font-weight: 500;
}

.form-feedback.hidden {
  display: none;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-dark);
  transition: border-color .15s, box-shadow .15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
  color: #9ca3af;
}

.form-error {
  margin-top: 8px;
  font-size: 14px;
  color: #dc2626;
  font-weight: 500;
}

.form-error.hidden {
  display: none;
}

/* OCR Placeholder Card */
.ocr-placeholder-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px dashed #0ea5e9;
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 32px;
}

.ocr-placeholder-icon {
  color: #0ea5e9;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  padding: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ocr-placeholder-title {
  font-size: 18px;
  font-weight: 700;
  color: #0c4a6e;
  margin-bottom: 8px;
}

.ocr-placeholder-text {
  font-size: 14px;
  color: #0369a1;
  line-height: 1.5;
}

/* Manual Data Section */
.data-section {
  background: #f9fafb;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.data-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.data-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
}

.form-submit {
  width: 100%;
  padding: 14px;
  background: var(--blue-mid);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.form-submit:hover {
  background: var(--blue);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 24px;
}

.form-link {
  color: var(--blue-mid);
  text-decoration: none;
  font-weight: 500;
}

.form-link:hover {
  text-decoration: underline;
}

/* ── TABS ── */
.tab-container {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.tab-button {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -2px;
}

.tab-button:hover {
  color: var(--blue-mid);
}

.tab-button.active {
  color: var(--blue-mid);
  border-bottom-color: var(--blue-mid);
}

.tab-content {
  margin-bottom: 24px;
}

.registration-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.registration-type-description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 24px;
}

/* ── ID UPLOAD CARD ── */
.id-upload-card {
  background: #f3e8ff;
  border: 1px solid #d8b4fe;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.id-upload-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.id-upload-card > p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.upload-box {
  border: 2px dashed #a855f7;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: rgba(168, 85, 247, 0.05);
  position: relative;
  overflow: hidden;
}

.upload-box:hover {
  border-color: #9333ea;
  background: rgba(168, 85, 247, 0.1);
}

.upload-box.loading {
  cursor: wait;
  opacity: 0.98;
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
}

.upload-box.loading::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  height: 8px;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.2);
  overflow: hidden;
}

.upload-box.loading::before {
  content: '';
  position: absolute;
  left: 16px;
  bottom: 16px;
  height: 8px;
  width: 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 60%, #a5b4fc 100%);
  animation: progress-bar 2s linear infinite;
}

.upload-box.loading p::after {
  content: ' Extracting text...';
  display: block;
  margin-top: 12px;
  font-size: 13px;
  color: #4f46e5;
}

@keyframes progress-bar {
  0% { width: 0%; }
  50% { width: 75%; }
  100% { width: 100%; }
}

.upload-box svg {
  color: #a855f7;
  margin-bottom: 12px;
}

.upload-box p {
  font-size: 14px;
  font-weight: 500;
  color: #9333ea;
  margin: 0;
}

/* ── EXTRACTED DATA SECTION ── */
.extracted-data-section {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.extracted-data-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.extracted-data-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.form-input-readonly {
  background: #e5e7eb;
  cursor: not-allowed;
  color: #6b7280;
}

.form-input-readonly:focus {
  outline: none;
  border-color: var(--border);
  box-shadow: none;
}

/* ── REVIEW SCREEN ── */
.review-screen {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}

.review-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.review-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

#reviewContent {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.review-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.review-item:last-child {
  border-bottom: none;
}

.review-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.review-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  text-align: right;
  max-width: 60%;
}

.review-actions {
  display: flex;
  gap: 12px;
}

.review-actions .btn-outline {
  flex: 1;
}

.review-actions .form-submit {
  flex: 1;
}

.hidden {
  display: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  nav {
    padding: 0 20px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 56px 20px 72px;
  }

  .hero-inner {
    flex-direction: column;
    gap: 40px;
  }

  .hero-content {
    text-align: center;
  }

  .hero-image img {
    max-width: 100%;
  }

  .hero-title {
    font-size: 36px;
  }

  .services {
    padding: 60px 20px;
  }

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

  .footer {
    padding: 60px 20px 32px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
