/* Code2Box Date Tools: shared shell (tokens, fonts, header, footer, cards, controls). */
@font-face { font-family: "Satoshi"; src: url("/tools/date-shared/fonts/satoshi-variable.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/tools/date-shared/fonts/geist-mono-latin.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("/tools/date-shared/fonts/cairo-arabic.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; src: url("/tools/date-shared/fonts/cairo-latin.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #0d1424; --surface: #141d31; --surface-2: #1b2640;
  --ink: #f2f5fb; --muted: #a3b0c8; --line: #27344f;
  --accent: #0a84ff; --accent-ink: #06162f; --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
  --ok: #34d399; --warn: #fbbf24;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 14px 34px rgba(0, 0, 0, .28);
  --font-ui: "Satoshi", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "Satoshi", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
html[lang="ar"] { --font-ui: "Cairo", system-ui, sans-serif; --font-num: "Cairo", system-ui, sans-serif; }

*, ::before, ::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { margin: 0; min-height: 100svh; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 16px; line-height: 1.55; overflow-x: hidden; }
html[lang="ar"] body { line-height: 1.8; }
h1, h2, h3, h4, p, figure, dl, dd, ol, ul { margin: 0; }
ol, ul { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { background: transparent; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.c2b-wrap { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 20px; }

/* Header */
.c2b-head { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.c2b-head-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.c2b-logo img { height: 28px; width: auto; }
.c2b-nav { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.c2b-nav a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 12px; border-radius: 999px; color: var(--muted); }
.c2b-nav a:hover { color: var(--ink); }
.c2b-nav .c2b-lang { color: var(--ink); border: 1px solid var(--line); min-height: 38px; }
.c2b-nav .c2b-lang:hover { border-color: var(--accent); }

/* Hero */
.c2b-hero { padding-block: 28px 18px; }
.c2b-kicker { font-size: 12.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
html[lang="ar"] .c2b-kicker { letter-spacing: 0; font-size: 13.5px; }
.c2b-h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
html[lang="ar"] .c2b-h1 { letter-spacing: 0; line-height: 1.35; }
.c2b-lede { margin-top: 8px; font-size: clamp(15.5px, 2.4vw, 18px); color: var(--muted); max-width: 62ch; }

/* Cards and grids */
.c2b-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.c2b-grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .c2b-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; } .c2b-card { padding: 26px; } }

/* Buttons */
.c2b-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding-inline: 20px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px; border: 1px solid transparent; transition: transform .12s ease, filter .12s ease, border-color .12s ease; -webkit-tap-highlight-color: transparent; }
.c2b-btn:hover { filter: brightness(1.08); }
.c2b-btn:active { transform: translateY(1px); }
.c2b-btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.c2b-btn--ghost:hover { border-color: var(--accent); filter: none; }
.c2b-btn--sm { min-height: 44px; padding-inline: 14px; font-size: 14px; }

/* Fields */
.c2b-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.c2b-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.c2b-input, .c2b-select { width: 100%; min-height: 48px; padding-inline: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background-color: var(--surface-2); color: var(--ink); font-size: 16px; font-weight: 600; }
.c2b-select { appearance: none; -webkit-appearance: none; padding-inline-end: 34px; background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a3b0c8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[dir="rtl"] .c2b-select { background-position: left 12px center; }
.c2b-input:hover, .c2b-select:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.c2b-select option { background: var(--surface-2); color: var(--ink); }

/* Segmented control */
.c2b-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; }
.c2b-seg button { min-height: 40px; padding-inline: 16px; border-radius: 999px; font-size: 14.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.c2b-seg button[aria-pressed="true"], .c2b-seg button.is-on { background: var(--accent); color: var(--accent-ink); }

/* Results */
.c2b-big { font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-size: clamp(24px, 5.6vw, 38px); line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
html[lang="ar"] .c2b-big { font-weight: 800; line-height: 1.45; letter-spacing: 0; }
.c2b-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 620px) { .c2b-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.c2b-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; min-width: 0; }
.c2b-stat-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: clamp(18px, 4.4vw, 24px); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
html[lang="ar"] .c2b-stat-num { font-weight: 700; }
.c2b-stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.c2b-note { font-size: 13px; color: var(--muted); }
.c2b-error { font-size: 14px; font-weight: 600; color: var(--warn); }

/* Sections, FAQ */
.c2b-section { padding-block: 36px 8px; }
.c2b-h2 { font-size: clamp(20px, 3.6vw, 26px); font-weight: 800; letter-spacing: -.01em; margin-bottom: 14px; }
html[lang="ar"] .c2b-h2 { letter-spacing: 0; }
.c2b-section p, .c2b-section li { color: var(--muted); max-width: 70ch; }
.c2b-section li + li { margin-top: 8px; }
.c2b-faq { display: grid; gap: 10px; }
.c2b-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 16px; }
.c2b-faq summary { cursor: pointer; font-weight: 700; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; color: var(--ink); }
.c2b-faq summary::-webkit-details-marker { display: none; }
.c2b-faq summary::after { content: "+"; font-family: var(--font-num); font-size: 20px; color: var(--accent); flex: none; }
.c2b-faq details[open] summary::after { content: "\2212"; }
.c2b-faq details p { padding-bottom: 14px; color: var(--muted); }

/* Footer */
.c2b-foot { margin-top: 48px; border-top: 1px solid var(--line); padding-block: 26px 40px; font-size: 14px; color: var(--muted); }
.c2b-foot-in { display: flex; flex-direction: column; gap: 14px; }
.c2b-foot a { color: var(--ink); }
.c2b-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.c2b-tool-link { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--ink); }
.c2b-tool-link:hover, .c2b-tool-link[aria-current="page"] { border-color: var(--accent); }

@media (max-width: 480px) {
  .c2b-wrap { padding-inline: 16px; }
  .c2b-hero { padding-block: 18px 12px; }
  .c2b-card { padding: 16px; }
  .c2b-nav a:not(.c2b-lang) { display: none; }
  .c2b-select { padding-inline: 12px 28px; background-position: right 10px center; }
  html[dir="rtl"] .c2b-select { background-position: left 10px center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --muted: #333; --line: #bbb; --accent: #000; --accent-ink: #fff; --shadow: none; color-scheme: light; }
  .c2b-head, .c2b-foot { display: none !important; }
}
