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

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text',
    'Segoe UI', sans-serif;
  background: radial-gradient(circle at top left, #dcfce7, #f8fafc 45%, #fefce8);
  color: #022c22;
}

body {
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.header {
  max-width: 1040px;
  margin: 0 auto 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 0.9rem;
  color: #4b5563;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
  transition: color 120ms, background 120ms;
}

.nav-link:hover,
.nav-link.active {
  color: #2563eb;
}

.nav-link.active {
  font-weight: 600;
}

.brand-text h1 {
  font-size: 1.25rem;
  margin: 0;
}

.brand-text p {
  font-size: 0.8rem;
  margin: 0;
  color: #64748b;
}

.main {
  flex: 1;
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2.25rem;
  align-items: center;
}

.hero-text h1,
.hero-text h2 {
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 0.75rem;
}

.hero-text p {
  margin: 0 0 1.25rem;
  color: #4b5563;
  font-size: 0.98rem;
}

.hero-text span {
  font-weight: 600;
  color: #2563eb;
}

.pill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.pill-list li {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 500;
}

.card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1.4rem;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(18px);
}

.dropzone {
  border-radius: 1rem;
  border: 1.8px dashed rgba(148, 163, 184, 0.8);
  padding: 1.5rem 1.25rem;
  text-align: center;
  background: radial-gradient(circle at top, rgba(219, 234, 254, 0.7), #f8fafc);
  position: relative;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.dropzone:hover {
  border-color: #2563eb;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.dropzone.drag-over {
  border-color: #22c55e;
  background: radial-gradient(circle at top, #bbf7d0, #ecfeff);
}

.drop-icon {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.drop-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.drop-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

#file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.8rem;
}

.file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-change {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.file-change:hover {
  text-decoration: underline;
}

.helper-text {
  margin-top: 0.8rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.helper-text p {
  margin: 0.1rem 0;
}

.primary-button {
  margin-top: 1rem;
  width: 100%;
  border-radius: 999px;
  height: 2.5rem;
  border: none;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.45);
  transition: transform 100ms ease, box-shadow 100ms ease, filter 100ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 18px 38px rgba(79, 70, 229, 0.5);
}

.primary-button:active {
  transform: translateY(0);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

.primary-button[disabled] {
  opacity: 0.75;
  cursor: default;
  box-shadow: none;
}

.primary-button.loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(239, 246, 255, 0.7);
  border-top-color: white;
  animation: spin 0.7s linear infinite;
}

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

.status {
  min-height: 1.2rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
}

.status.error {
  color: #b91c1c;
}

.status.success {
  color: #15803d;
}

.content-page {
  padding: 0.5rem 0;
}

.content-page h1 {
  font-size: 1.8rem;
  margin: 0 0 1rem;
}

.content-page h2 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

.content-page p {
  margin: 0 0 0.75rem;
  color: #4b5563;
  line-height: 1.6;
}

.content-page a {
  color: #2563eb;
  text-decoration: none;
}

.content-page a:hover {
  text-decoration: underline;
}

/* Age calculator specific styles */

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 0.4rem;
}

.date-input {
  width: 100%;
  border-radius: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
  background-color: rgba(248, 250, 252, 0.9);
  transition: border-color 120ms ease, box-shadow 120ms ease,
    background-color 120ms ease;
}

.date-input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.2),
    0 8px 20px rgba(22, 163, 74, 0.25);
  background-color: #ffffff;
}

.date-input:invalid {
  box-shadow: none;
}

.results {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.result-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 0.6rem;
}

.result-label {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

.result-age {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #065f46;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.result-pill {
  border-radius: 999px;
  padding: 0.45rem 0.35rem;
  background: rgba(187, 247, 208, 0.8);
  border: 1px solid rgba(74, 222, 128, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
}

.result-number {
  font-weight: 700;
  font-size: 0.9rem;
  color: #14532d;
}

.result-unit {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #166534;
}

.result-extra {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: #4b5563;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 8px 20px rgba(148, 163, 184, 0.25);
}

.feature h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.feature p {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.footer {
  max-width: 1040px;
  margin: 2rem auto 0.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: #9ca3af;
}

@media (max-width: 800px) {
  .page {
    padding: 1.25rem;
  }

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

@media (max-width: 600px) {
  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .card {
    padding: 1.25rem;
  }
}

