/* PH Tax Tools — shared styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #1a56db;
  --blue-dark: #1341ad;
  --blue-light: #e8f0fe;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;
  --bg: #f9fafb;
  --white: #ffffff;
  --green: #059669;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1);
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
}

/* Header */
header {
  background: var(--blue);
  color: var(--white);
  padding: 0 1rem;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 1rem;
}
.site-name {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--white);
  white-space: nowrap;
}
nav { display: flex; gap: .5rem; flex-wrap: wrap; }
nav a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: .8rem;
  padding: .25rem .5rem;
  border-radius: 4px;
  white-space: nowrap;
}
nav a:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Main layout */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

h1 { font-size: 1.6rem; margin-bottom: .25rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; color: var(--blue-dark); }
.subtitle { color: var(--muted); margin-bottom: 1.5rem; font-size: .95rem; }

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

/* Form elements */
.field { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .9rem; }
input[type="number"], input[type="date"], select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .75rem;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus { outline: 2px solid var(--blue); border-color: var(--blue); }

.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 180px; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: .7rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: .5rem;
}
.btn:hover { background: var(--blue-dark); }
.btn-outline {
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
}
.btn-outline:hover { background: var(--blue-light); }
.btn-green { background: var(--green); }
.btn-green:hover { background: #047857; }

/* Results table */
.result-table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.result-table td { padding: .55rem .5rem; border-bottom: 1px solid var(--border); font-size: .95rem; }
.result-table td:last-child { text-align: right; font-weight: 600; }
.result-table tr.total td { font-weight: 700; font-size: 1.05rem; border-bottom: none; padding-top: .75rem; }
.result-table tr.total td:last-child { color: var(--green); font-size: 1.15rem; }
.result-table tr.deduction td:last-child { color: #dc2626; }

/* Result hidden until calculated */
#result { display: none; }

/* Data tables (BIR calendar, etc.) */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { background: var(--blue); color: #fff; padding: .5rem .75rem; text-align: left; }
.data-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: var(--blue-light); }

/* AdSense placeholders */
.ad-slot {
  background: #f3f4f6;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: .8rem;
  margin-bottom: 1.25rem;
}

/* Tool grid on index */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.tool-card:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(26,86,219,.15); }
.tool-card h3 { font-size: 1rem; color: var(--blue); margin-bottom: .35rem; }
.tool-card p { font-size: .85rem; color: var(--muted); }

/* Affiliate buttons */
.affiliate-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.affiliate-btn {
  flex: 1;
  min-width: 150px;
  display: inline-block;
  text-align: center;
  padding: .65rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  cursor: pointer;
}
.affiliate-btn.wise { background: #9dfad9; color: #003b2d; }
.affiliate-btn.remitly { background: #e8173a; color: #fff; }
.affiliate-btn.wu { background: #ffcd00; color: #333; }
.affiliate-btn.gcash { background: #0070e0; color: #fff; }

/* Highlight box */
.highlight {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  padding: .75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .9rem;
  margin-bottom: 1rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: .8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
footer a { color: var(--muted); }

@media (max-width: 480px) {
  h1 { font-size: 1.3rem; }
  nav { display: none; }
  .row { flex-direction: column; }
}
