/* AquaMath.online — polished aquatic theme */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Outfit:wght@600;700;800&display=swap');

:root {
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --teal-900: #134e4a;
  --sky-400: #38bdf8;
  --sky-500: #0ea5e9;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --white: #ffffff;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 4px 24px rgba(15, 118, 110, 0.08);
  --shadow-md: 0 8px 30px rgba(15, 118, 110, 0.12);
  --shadow-lg: 0 16px 48px rgba(15, 118, 110, 0.14);
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'DM Sans', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: linear-gradient(165deg, #f0fdfa 0%, #e0f2fe 45%, #f8fafc 100%);
  background-attachment: fixed;
  color: var(--slate-800);
  line-height: 1.65;
  min-height: 100vh;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-700); text-decoration: none; }
a:hover { color: var(--teal-600); }

.container {
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(13, 148, 136, 0.12);
  box-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--teal-800);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.logo span { color: var(--teal-500); font-weight: 600; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 1rem;
  flex-wrap: wrap;
}
.nav > a {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--slate-600);
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
}
.nav > a:hover { background: var(--teal-50); color: var(--teal-700); }

.lang-switcher {
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
  padding: 0.2rem;
  background: var(--slate-100);
  border-radius: var(--radius-pill);
}
.lang-switcher a {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.5rem;
  border-radius: var(--radius-pill);
  color: var(--slate-600);
  text-transform: uppercase;
}
.lang-switcher a:hover,
.lang-switcher a.active {
  background: var(--teal-600);
  color: white;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  position: relative;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--teal-900);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}
.hero p {
  font-size: 1.08rem;
  color: var(--slate-600);
  max-width: 560px;
  margin: 0 auto;
}

/* ===== STICKY TABS ===== */
.aqua-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.65rem 0.25rem 0.9rem;
  margin: 0.5rem 0 1.25rem;
  position: sticky;
  top: 58px;
  z-index: 90;
  background: linear-gradient(180deg, rgba(240,253,250,0.97) 70%, transparent);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.aqua-tabs::-webkit-scrollbar { display: none; }

.aqua-tab {
  flex: 0 0 auto;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--teal-200);
  background: var(--white);
  color: var(--teal-800);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.06);
  transition: all 0.18s ease;
}
.aqua-tab:hover {
  border-color: var(--teal-400);
  background: var(--teal-50);
  transform: translateY(-1px);
}
.aqua-tab.active {
  background: linear-gradient(135deg, var(--teal-600), var(--teal-700));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

/* ===== PANELS & CARDS ===== */
.panel { display: none; animation: fadeUp 0.3s ease; }
.panel.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.quick-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}
.quick-jump a {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: var(--white);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
  transition: 0.15s;
}
.quick-jump a:hover {
  background: var(--teal-100);
  border-color: var(--teal-400);
}

.calc-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.5rem;
  margin-bottom: 1.15rem;
  border: 1px solid rgba(13, 148, 136, 0.1);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.calc-card:hover { box-shadow: var(--shadow-md); }

.calc-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--teal-900);
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.calc-card .note {
  font-size: 0.88rem;
  color: var(--slate-500);
  margin-bottom: 1rem;
}

/* ===== FORMS ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal-800);
  margin-bottom: 0.3rem;
  letter-spacing: 0.01em;
}

.field input,
.field select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--slate-800);
  background: var(--slate-50);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--teal-400);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.25);
}
.field input::placeholder { color: var(--slate-300); }

.btn-calc {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
  color: white;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.btn-calc:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}
.btn-calc:active { transform: translateY(0); }

/* ===== RESULTS ===== */
.result-box {
  display: none;
  margin-top: 1.15rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #ccfbf1 100%);
  border: 1px solid var(--teal-200);
  animation: fadeUp 0.35s ease;
}
.result-box.show { display: block; }
.result-box.warning {
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  border-color: #fca5a5;
}
.result-box .result-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal-700);
  margin-bottom: 0.25rem;
}
.result-box.warning .result-label { color: #b91c1c; }
.result-box .result-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--teal-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.result-box.warning .result-value { color: #991b1b; }
.result-box .result-detail {
  font-size: 0.9rem;
  color: var(--slate-600);
  margin-top: 0.35rem;
}

/* ===== SEO BLOCK ===== */
.seo-block {
  margin: 2.5rem 0 2rem;
  padding: 1.75rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow);
}
.seo-block h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--teal-900);
  margin-bottom: 0.75rem;
}
.seo-block h3 {
  font-size: 1.05rem;
  color: var(--teal-800);
  margin: 1.25rem 0 0.5rem;
}
.seo-block p, .seo-block li {
  color: var(--slate-600);
  font-size: 0.95rem;
}
.seo-block ul { padding-left: 1.25rem; margin: 0.5rem 0; }
.seo-block li { margin: 0.3rem 0; }

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 3rem;
  background: linear-gradient(180deg, var(--teal-800), var(--teal-900));
  color: var(--teal-100);
  padding: 2.5rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  padding-bottom: 2rem;
}
.site-footer h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: white;
  margin-bottom: 0.6rem;
}
.site-footer a {
  display: block;
  color: var(--teal-200);
  font-size: 0.9rem;
  margin: 0.3rem 0;
}
.site-footer a:hover { color: white; }
.site-footer p { font-size: 0.9rem; color: var(--teal-200); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1rem 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--teal-300);
}

/* ===== SUPPORT PAGES ===== */
main.container { padding-bottom: 2rem; }

/* ===== RTL ===== */
[dir="rtl"] .nav { flex-direction: row-reverse; }
[dir="rtl"] .form-grid { direction: rtl; }
[dir="rtl"] .aqua-tabs { flex-direction: row-reverse; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .hero { padding: 1.75rem 0.5rem 1rem; }
  .hero h1 { font-size: 1.6rem; }
  .calc-card { padding: 1.1rem; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .aqua-tabs { top: 52px; }
  .header-inner { padding: 0.65rem 0; }
}
@media (max-width: 400px) {
  .form-grid { grid-template-columns: 1fr; }
}
