/* ===== Utility Hub — Shared Styles (MOSSA Brand — Light & Warm) ===== */
:root {
  color-scheme: light;
  forced-color-adjust: none;
  --bg: #FBF7EE;
  --surface: #FFFFFF;
  --surface-2: #F5F0E3;
  --border: #E2DCCB;
  --border-strong: #C9C2AE;
  --text: #1B3A5C;
  --text-body: #2D4A6A;
  --text-dim: #6B7B8E;
  --accent: #6B8E5A;
  --accent-hover: #5A7A49;
  --accent-light: #E8F0E0;
  --accent-dim: rgba(107, 142, 90, 0.12);
  --gold: #D4A02A;
  --gold-light: #FBF3DD;
  --warning: #C7842A;
  --warning-light: #FBF0DC;
  --danger: #B8523A;
  --danger-light: #FBE8E2;
  --success: #4A7A3A;
  --success-light: #E8F3E0;
  --radius: 14px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Georgia, serif;
  --mono: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  --shadow: 0 2px 8px rgba(27, 58, 92, 0.08);
  --shadow-hover: 0 4px 16px rgba(27, 58, 92, 0.12);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: #FBF7EE !important; color-scheme: light; }
body {
  font-family: var(--font);
  font-size: 17px;
  background: var(--bg);
  color: var(--text-body);
  min-height: 100vh;
  line-height: 1.65;
}
/* NAV */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 64px;
  background: var(--surface); border-bottom: 2px solid var(--accent);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--accent);
  font-weight: 700; font-size: 20px;
}
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  text-decoration: none; color: var(--text-dim);
  padding: 8px 14px; border-radius: 8px;
  font-size: 15px; font-weight: 500;
  transition: all 0.15s;
}
.nav-links a:hover { background: var(--accent-light); color: var(--accent); }
.nav-links a.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

/* CONTAINER */
.container { max-width: 700px; margin: 0 auto; padding: 32px 24px; }

/* HERO */
.hero { text-align: center; padding: 32px 0 24px; }
.hero h1 {
  font-size: 32px; font-weight: 800; color: var(--text); margin-bottom: 10px;
}
.hero p { color: var(--text-dim); font-size: 17px; max-width: 500px; margin: 0 auto; }

/* TOOL GRID */
.tool-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin-top: 28px;
}
.tool-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  text-decoration: none; padding: 28px 20px;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  transition: all 0.2s; box-shadow: var(--shadow);
}
.tool-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.tool-card .icon { font-size: 36px; margin-bottom: 12px; }
.tool-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.tool-card p { font-size: 15px; color: var(--text-dim); }

/* CARD */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.card p { color: var(--text-dim); font-size: 16px; margin-bottom: 14px; }

/* INPUT */
input[type="text"], input[type="number"], input[type="tel"], input[type="email"] {
  width: 100%; padding: 14px 16px;
  background: var(--surface-2); border: 2px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 17px; font-family: var(--font);
  outline: none; transition: border-color 0.2s;
}
input:focus { border-color: var(--accent); }
input::placeholder { color: var(--text-dim); }
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* SELECT */
select {
  width: 100%; padding: 14px 16px;
  background: var(--surface-2); border: 2px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 17px; font-family: var(--font);
  outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B8E5A' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}

/* BUTTON */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 32px; border: none; border-radius: var(--radius-sm);
  font-size: 18px; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: all 0.15s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--surface-2); color: var(--text);
  border: 2px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--accent-light); border-color: var(--accent); }
.btn-lg { padding: 18px 36px; font-size: 19px; }
.btn-full { width: 100%; }

/* WORD RESULTS */
.word-results { margin-top: 16px; }
.word-group { margin-bottom: 16px; }
.word-group-title {
  font-size: 14px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.word-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.word-chip {
  display: inline-block; padding: 8px 14px;
  background: var(--accent-light); border: 1px solid var(--accent);
  border-radius: 8px; font-size: 16px; font-weight: 600; color: var(--text);
  font-family: var(--mono);
}

/* PASSWORD DISPLAY */
.password-display {
  font-family: var(--mono); font-size: 22px; font-weight: 700;
  padding: 20px; background: var(--surface-2);
  border: 2px solid var(--accent); border-radius: var(--radius-sm);
  text-align: center; word-break: break-all; color: var(--text);
}
.strength-bar {
  height: 10px; background: var(--surface-2);
  border-radius: 5px; overflow: hidden; margin-top: 12px;
}
.strength-fill {
  height: 100%; transition: width 0.3s, background 0.3s;
  border-radius: 5px;
}

/* CONVERTER */
.converter-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 12px;
}
.converter-output {
  padding: 14px 16px; background: var(--accent-light);
  border: 2px solid var(--accent); border-radius: var(--radius-sm);
  font-size: 17px; color: var(--text); font-weight: 600;
}
.converter-list { margin-top: 16px; }
.converter-item {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 16px;
}
.converter-item:last-child { border-bottom: none; }
.converter-item .unit { color: var(--text-dim); }
.converter-item .value { font-weight: 700; color: var(--text); }

/* QR CODE */
#qrcode {
  display: flex; justify-content: center; padding: 24px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  margin: 16px 0; min-height: 200px;
}
#qrcode img, #qrcode canvas {
  border-radius: 8px; border: 4px solid var(--surface);
  box-shadow: var(--shadow);
}

/* SLIDER */
.slider-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.slider-row label { font-size: 16px; color: var(--text); min-width: 100px; }
.slider-row input[type="range"] { flex: 1; }
.slider-val {
  font-size: 16px; font-weight: 700; color: var(--accent);
  min-width: 60px; text-align: right;
}

/* TOGGLE */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
}
.toggle {
  position: relative; width: 46px; height: 26px;
  background: var(--surface-2); border: 2px solid var(--border-strong);
  border-radius: 13px; cursor: pointer; transition: background 0.2s;
}
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
.toggle.on::after { transform: translateX(18px); }

/* ALERT */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 15px; margin-bottom: 12px;
}
.alert-success { background: var(--success-light); color: var(--success); }
.alert-warning { background: var(--warning-light); color: var(--warning); }
.alert-danger { background: var(--danger-light); color: var(--danger); }

/* FOOTER */
.footer {
  text-align: center; padding: 28px 24px;
  color: var(--text-dim); font-size: 15px;
  border-top: 1px solid var(--border); margin-top: 40px;
}
.footer a { color: var(--accent); }

/* RESPONSIVE */
@media (max-width: 600px) {
  .container { padding: 20px 16px; }
  .hero h1 { font-size: 26px; }
  .tool-grid { grid-template-columns: 1fr; }
  .converter-row { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .btn { font-size: 17px; padding: 14px 28px; }
}

/* ===== iPHONE / MOBILE FIXES ===== */
@media (max-width: 480px) {
  /* Container & spacing */
  .container { padding: 16px 12px; }
  .hero { padding: 16px 0 8px; }
  .hero h1 { font-size: 22px; line-height: 1.3; }
  .hero p { font-size: 15px; }

  /* Nav — prevent overlap */
  .nav { padding: 0 12px; height: 56px; }
  .nav-brand { font-size: 16px; white-space: nowrap; }

  /* Cards */
  .card { padding: 18px 14px; margin-bottom: 14px; }
  .card h2 { font-size: 18px; }
  .card p { font-size: 15px; }

  /* Tool grid — single column */
  .tool-grid { grid-template-columns: 1fr; gap: 12px; }
  .tool-card { padding: 20px 16px; }
  .tool-card .icon { font-size: 28px; }
  .tool-card h3 { font-size: 17px; }
  .tool-card p { font-size: 13px; }

  /* Inputs — prevent iOS zoom, keep readable */
  input[type="text"], input[type="number"], input[type="tel"], input[type="email"] {
    font-size: 16px; padding: 12px 14px;
  }
  select { font-size: 16px; padding: 12px 14px; }

  /* Buttons — full width, touch-friendly */
  .btn {
    display: flex; width: 100%; padding: 16px 20px;
    font-size: 17px; justify-content: center;
    -webkit-tap-highlight-color: rgba(107,142,90,0.2);
    touch-action: manipulation;
  }
  .btn-lg { padding: 18px 20px; font-size: 18px; }

  /* Word results */
  .word-chip { padding: 6px 12px; font-size: 14px; }
  .word-group-title { font-size: 13px; }

  /* Password display */
  .password-display { font-size: 16px; padding: 14px; word-break: break-all; }
  .strength-bar { height: 8px; }

  /* Converter — stack vertically */
  .converter-row { grid-template-columns: 1fr; gap: 10px; }
  .converter-output { font-size: 15px; padding: 12px 14px; }
  .converter-item { font-size: 14px; padding: 8px 0; }

  /* QR code */
  #qrcode { padding: 16px; min-height: 160px; }
  #qrcode img, #qrcode canvas { max-width: 200px; }

  /* Slider */
  .slider-row { gap: 8px; }
  .slider-row label { font-size: 14px; min-width: 80px; }
  .slider-val { font-size: 14px; min-width: 50px; }

  /* Toggle */
  .toggle { width: 44px; height: 24px; }
  .toggle::after { width: 16px; height: 16px; }
  .toggle.on::after { transform: translateX(16px); }

  /* Alert */
  .alert { font-size: 14px; padding: 10px 12px; }

  /* Email capture */
  .email-capture-box { padding: 20px 16px; margin: 20px auto; }
  .email-capture-box h3 { font-size: 18px; }
  .email-capture-box p { font-size: 13px; }
  .email-form { flex-direction: column; gap: 10px; }
  .email-input-field { width: 100%; font-size: 16px; }
  .email-form .btn { width: 100%; }

  /* Footer */
  .footer { padding: 20px 12px; font-size: 13px; }
  .cross-promo a { font-size: 12px; }
}

/* Extra small phones (iPhone SE) */
@media (max-width: 360px) {
  .container { padding: 12px 8px; }
  .hero h1 { font-size: 20px; }
  .card { padding: 14px 10px; }
  .card h2 { font-size: 16px; }
  .nav-brand { font-size: 14px; }
  .btn { font-size: 16px; padding: 14px 16px; }
  .tool-card { padding: 16px 12px; }
  .word-chip { padding: 5px 10px; font-size: 13px; }
  .password-display { font-size: 14px; padding: 12px; }
}

/* EMAIL CAPTURE */
.email-capture-box {
  max-width: 520px; margin: 32px auto; text-align: center;
  background: var(--surface); border: 2px solid var(--accent);
  border-radius: var(--radius); padding: 28px 24px;
  box-shadow: var(--shadow);
}
.email-capture-icon { font-size: 32px; margin-bottom: 8px; }
.email-capture-box h3 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.email-capture-box p { font-size: 14px; color: var(--text-dim); margin-bottom: 16px; line-height: 1.5; }
.email-form { display: flex; gap: 8px; max-width: 400px; margin: 0 auto; }
.email-input-field {
  flex: 1; padding: 12px 14px; font-size: 16px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
.email-input-field:focus { outline: none; border-color: var(--accent); }
.email-success {
  font-size: 15px; color: var(--success); font-weight: 600;
  margin-top: 12px; padding: 10px; background: var(--success-light);
  border-radius: var(--radius-sm);
}
.email-privacy { font-size: 12px; color: var(--text-dim); margin-top: 10px; }
@media (max-width: 480px) {
  .email-form { flex-direction: column; }
  .email-input-field { width: 100%; }
  .email-form .btn { width: 100%; }
}

/* CROSS-PROMOTION FOOTER */
.cross-promo {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 13px; text-align: center;
}
.cross-promo p { color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.cross-promo a {
  color: var(--accent); text-decoration: none; font-size: 13px;
  display: inline-block; margin: 2px 0;
}
.cross-promo a:hover { text-decoration: underline; }
