/* ============================================================
   Tip Calculator — style.css
   Self-contained. No shared dependencies.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:      #0d9488;
  --brand-dark: #0f766e;
  --brand-lite: #ccfbf1;
  --bg:         #f0fdfa;
  --surface:    #ffffff;
  --border:     #99f6e4;
  --text:       #134e4a;
  --muted:      #64748b;
  --success:    #0d9488;
  --danger:     #ef4444;
  --radius:     14px;
  --shadow:     0 2px 16px rgba(13,148,136,.09);
  --shadow-lg:  0 8px 32px rgba(13,148,136,.18);
  --font:       'Inter', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }

.skip-link { position: absolute; top: -40px; left: 0; background: var(--brand); color: #fff; padding: 8px 16px; border-radius: 0 0 8px 0; font-size: .9rem; font-weight: 700; transition: top .2s; z-index: 100; }
.skip-link:focus { top: 0; }

.site-header { background: linear-gradient(135deg, #065f46 0%, #0d9488 55%, #2dd4bf 100%); color: #fff; box-shadow: 0 2px 12px rgba(13,148,136,.3); }
.header-inner { max-width: 900px; margin: 0 auto; padding: 32px 24px 28px; text-align: center; }
.header-badge { display: inline-block; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); border-radius: 20px; padding: 4px 14px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.site-header h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; letter-spacing: -.5px; line-height: 1.1; margin-bottom: 10px; }
.site-header h1 .highlight { color: #fbbf24; }
.site-header .tagline { font-size: clamp(.95rem, 2vw, 1.1rem); opacity: .88; max-width: 520px; margin: 0 auto; }

.ad-unit { background: #f0fdfa; border: 2px dashed #5eead4; border-radius: 10px; text-align: center; padding: 16px; font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #14b8a6; min-height: 60px; display: flex; align-items: center; justify-content: center; }
.ad-wrap-top    { max-width: 900px; margin: 28px auto 0; padding: 0 24px; }
.ad-wrap-mid    { margin: 32px 0; }
.ad-wrap-bottom { max-width: 900px; margin: 0 auto 28px; padding: 0 24px; }

main { max-width: 900px; margin: 0 auto; padding: 32px 24px 64px; flex: 1; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; margin-bottom: 24px; box-shadow: var(--shadow); transition: box-shadow .2s; }
.card:hover { box-shadow: var(--shadow-lg); }

.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 2px solid var(--border); }
.card-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-lite); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.card-head h2 { font-size: 1.15rem; font-weight: 800; }
.card-head p  { font-size: .85rem; color: var(--muted); margin-top: 2px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
/* Keep the currency symbol in the bill-amount label in its original case (e.g. zł, kr, Fr, د.إ) */
.field-group label #bill-symbol { text-transform: none; letter-spacing: 0; font-weight: 700; }

.inputs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 18px; }

input[type="number"], select {
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 9px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  -moz-appearance: textfield;
  font-family: var(--font);
  width: 100%;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type="number"]:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,148,136,.13); background: #fff; }

.tip-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tip-btn { padding: 9px 16px; border: 2px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: .95rem; font-weight: 800; cursor: pointer; transition: all .15s; font-family: var(--font); }
.tip-btn:hover, .tip-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.btn-primary { padding: 12px 28px; background: var(--brand); color: #fff; border: none; border-radius: 9px; font-size: .97rem; font-weight: 800; cursor: pointer; transition: background .18s, transform .1s; box-shadow: 0 2px 8px rgba(13,148,136,.25); font-family: var(--font); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active { transform: scale(.97); }
.btn-ghost { padding: 12px 18px; background: transparent; color: var(--muted); border: 2px solid var(--border); border-radius: 9px; font-size: .9rem; font-weight: 700; cursor: pointer; transition: all .18s; font-family: var(--font); }
.btn-ghost:hover { border-color: #94a3b8; color: var(--text); }

.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 4px; }
.result-item { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.r-label { font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.r-value { font-size: 1.6rem; font-weight: 900; color: var(--brand); margin-top: 4px; line-height: 1.1; }
.r-sub   { font-size: .78rem; color: var(--muted); margin-top: 3px; }

.result-box { display: none; margin-top: 20px; padding: 22px; border-radius: 11px; background: linear-gradient(135deg, #f0fdfa, #ccfbf1); border: 2px solid #5eead4; animation: slideUp .25s ease; }
.result-box.visible { display: block; }
.result-box.is-error { background: linear-gradient(135deg, #fff1f2, #ffe4e6); border-color: #fca5a5; }
.error-msg { color: var(--danger); font-weight: 700; font-size: 1rem; }

@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.info-item { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.info-item h3 { font-size: .95rem; font-weight: 800; margin-bottom: 8px; }
.info-item p { font-size: .87rem; color: var(--muted); line-height: 1.6; }

.section-title { font-size: 1.25rem; font-weight: 900; margin-bottom: 18px; }

.faq-list details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq-list details:last-child { border-bottom: none; }
.faq-list summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .97rem; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; font-size: 1.3rem; color: var(--brand); font-weight: 900; flex-shrink: 0; }
.faq-list details[open] summary::after { content: '−'; }
.faq-list details p { margin-top: 10px; font-size: .92rem; color: var(--muted); line-height: 1.75; }

.site-footer { background: var(--text); color: #94a3b8; text-align: center; padding: 32px 24px; font-size: .88rem; margin-top: auto; }
.footer-nav { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.footer-nav a { color: #2dd4bf; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.footer-copy { color: #64748b; }

@media (max-width: 640px) {
  .card { padding: 20px 18px; }
  .inputs-grid { grid-template-columns: 1fr 1fr; }
  /* Give currency dropdown full width on phones so the long option labels fit */
  .inputs-grid .field-group:first-child { grid-column: 1 / -1; }
  .r-value { font-size: 1.3rem; }
}

/* ── Print styles ────────────────────────────────────────────── */
@media print {
  .ad-wrap-top, .ad-wrap-mid, .ad-wrap-bottom, .ad-unit { display: none !important; }
  .site-header { background: #fff !important; color: #000 !important; -webkit-print-color-adjust: exact; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  .btn-primary, .btn-ghost, .skip-link { display: none !important; }
  body { font-size: 12pt; }
}
