/* =============================================
   SalesTax4Me — Stylesheet
   Brand: Deep Teal #0e4d5c + Coral #f45b32
   ============================================= */

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

:root {
  --primary:       #0e4d5c;
  --primary-dark:  #083544;
  --primary-pale:  #eef7fa;
  --accent:        #f45b32;
  --accent-dark:   #d44820;
  --accent-pale:   #fff3f0;
  --bg:            #f5f9fa;
  --card:          #ffffff;
  --text:          #132830;
  --text-muted:    #3f6270;
  --border:        #cde3ea;
  --success:       #15803d;
  --danger:        #dc2626;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06);
  --shadow-md:     0 4px 16px rgba(14,77,92,.1);
  --radius:        12px;
  --radius-lg:     18px;
}

body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; font-size: 15px; }

/* --- Header --- */
.site-header { background: var(--primary); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.header-inner { max-width: 1140px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: .85rem 1.5rem; }
.site-logo { display: flex; align-items: center; gap: .5rem; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.25rem; color: #fff; text-decoration: none; }
.site-logo span { color: var(--accent); }
.header-nav { display: flex; gap: 1.5rem; }
.header-nav a { color: rgba(255,255,255,.82); text-decoration: none; font-size: .9rem; font-weight: 500; transition: color .2s; }
.header-nav a:hover { color: var(--accent); }

/* --- Hero --- */
.hero { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 65%, #1a6b82 100%); color: #fff; text-align: center; padding: 3.5rem 1.5rem 3rem; }
.hero-badge { display: inline-block; background: var(--accent); color: #fff; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: .3rem .9rem; border-radius: 999px; margin-bottom: 1.1rem; }
.hero h1 { font-family: 'Nunito', sans-serif; font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 900; line-height: 1.15; margin-bottom: .85rem; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.05rem; opacity: .9; max-width: 620px; margin: 0 auto 1.5rem; }
.hero-stats { display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap; }
.hero-stat strong { display: block; font-family: 'Nunito', sans-serif; font-size: 1.6rem; font-weight: 900; color: var(--accent); }
.hero-stat span { font-size: .78rem; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }

/* --- Tool Tabs --- */
.tool-tabs { background: var(--primary-dark); border-bottom: 3px solid var(--accent); }
.tool-tabs-inner { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; display: flex; overflow-x: auto; }
.tab-btn { background: none; border: none; color: rgba(255,255,255,.65); padding: .9rem 1.35rem; font-size: .88rem; font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -3px; white-space: nowrap; transition: all .2s; font-family: 'Inter', sans-serif; }
.tab-btn:hover { color: #fff; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Main --- */
.site-main { max-width: 1140px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.tool-section { display: none; }
.tool-section.active { display: block; }

/* --- Cards --- */
.card { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.card-title { font-family: 'Nunito', sans-serif; font-size: 1.05rem; font-weight: 900; color: var(--primary); margin-bottom: 1.1rem; }

/* --- Forms --- */
.field-group { margin-bottom: 1rem; }
.field-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-muted); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .04em; }
.input-wrap { position: relative; display: flex; }
.input-prefix, .input-suffix { display: flex; align-items: center; padding: 0 .75rem; background: var(--primary-pale); border: 1.5px solid var(--border); color: var(--text-muted); font-size: .9rem; font-weight: 600; border-radius: var(--radius) 0 0 var(--radius); }
.input-suffix { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
input, select { width: 100%; padding: .65rem .85rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: .95rem; font-family: inherit; color: var(--text); background: #fff; transition: border-color .2s; }
input:focus, select:focus { outline: none; border-color: var(--primary); }
input.has-prefix { border-left: none; border-radius: 0 var(--radius) var(--radius) 0; }
input.has-suffix { border-right: none; border-radius: var(--radius) 0 0 var(--radius); }
.hint { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; display: block; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* State select */
.state-select-wrap select { appearance: none; padding-right: 2.5rem; 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 d='M1 1l5 5 5-5' stroke='%233f6270' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; cursor: pointer; }

/* --- Result panel --- */
.result-panel { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: var(--radius-lg); padding: 1.75rem; color: #fff; }
.result-label { font-size: .78rem; opacity: .8; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .3rem; }
.result-main { font-family: 'Nunito', sans-serif; font-size: 2.4rem; font-weight: 900; color: var(--accent); line-height: 1.1; margin-bottom: .2rem; }
.result-sub { font-size: .85rem; opacity: .85; margin-top: .15rem; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 1.1rem; }
.result-item { background: rgba(255,255,255,.1); border-radius: 10px; padding: .7rem .9rem; }
.ri-label { font-size: .72rem; opacity: .75; text-transform: uppercase; letter-spacing: .05em; }
.ri-value { font-family: 'Nunito', sans-serif; font-size: 1.15rem; font-weight: 900; color: var(--accent); margin-top: .15rem; }
.result-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* --- Tax breakdown bar --- */
.breakdown-bar { margin-top: 1rem; }
.bar-track { height: 16px; background: rgba(255,255,255,.15); border-radius: 999px; overflow: hidden; display: flex; }
.bar-pretax { height: 100%; background: rgba(255,255,255,.6); border-radius: 999px 0 0 999px; transition: width .4s ease; }
.bar-tax { height: 100%; background: var(--accent); transition: width .4s ease; }
.bar-labels { display: flex; justify-content: space-between; font-size: .73rem; opacity: .75; margin-top: .4rem; }

/* --- Cart --- */
.cart-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cart-table th { background: var(--primary-pale); color: var(--primary); font-weight: 700; padding: .55rem .75rem; text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.cart-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-table tr:last-child td { border-bottom: none; }
.cart-table .total-row td { font-weight: 800; color: var(--primary); background: var(--primary-pale); font-size: .95rem; }
.cart-item-name { font-weight: 600; }
.remove-btn { background: none; border: none; cursor: pointer; color: var(--danger); font-size: 1rem; padding: .2rem .4rem; border-radius: 4px; }
.remove-btn:hover { background: #fef2f2; }
.add-item-row { display: flex; gap: .75rem; margin-top: 1rem; align-items: flex-end; flex-wrap: wrap; }
.add-item-row .field-group { margin: 0; flex: 1; min-width: 120px; }
.btn-add { background: var(--accent); color: #fff; border: none; padding: .65rem 1.25rem; border-radius: var(--radius); font-weight: 700; cursor: pointer; font-family: inherit; font-size: .9rem; white-space: nowrap; transition: background .2s; }
.btn-add:hover { background: var(--accent-dark); }

/* --- States explorer table --- */
.explorer-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.explorer-table th { background: var(--primary-pale); color: var(--primary); font-weight: 700; padding: .55rem .75rem; text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; }
.explorer-table th:hover { background: #d5edf4; }
.explorer-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
.explorer-table tr:hover td { background: var(--primary-pale); }
.explorer-table tr:last-child td { border-bottom: none; }
.tax-zero { color: var(--success); font-weight: 800; }
.no-sales-badge { background: #dcfce7; color: #15803d; font-size: .7rem; font-weight: 800; padding: .1rem .4rem; border-radius: 999px; margin-left: .3rem; }

/* --- Tips --- */
.tips-list { display: flex; flex-direction: column; gap: .75rem; }
.tip-item { display: flex; gap: .75rem; align-items: flex-start; }
.tip-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: .1rem; }
.tip-text { font-size: .87rem; color: var(--text-muted); line-height: 1.55; }
.tip-text strong { color: var(--text); }

/* --- Section title --- */
.section-title { font-family: 'Nunito', sans-serif; font-size: 1.25rem; font-weight: 900; color: var(--primary); padding-bottom: .6rem; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; }

/* --- Network nav --- */
.network-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .85rem; }
.net-card { display: flex; flex-direction: column; gap: .25rem; background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; text-decoration: none; transition: all .2s; }
.net-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.nc-icon { font-size: 1.4rem; }
.nc-name { font-weight: 800; font-size: .88rem; color: var(--primary); }
.nc-desc { font-size: .75rem; color: var(--text-muted); }

/* --- Ad slot --- */
.ad-slot { background: var(--card); border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; min-height: 90px; display: flex; align-items: center; justify-content: center; }

/* --- Cookie banner --- */
.cookie-banner { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: var(--primary-dark); color: #fff; border-radius: var(--radius); padding: 1rem 1.5rem; display: flex; align-items: center; gap: 1rem; max-width: 560px; width: calc(100% - 2rem); z-index: 9999; box-shadow: 0 8px 32px rgba(0,0,0,.25); flex-wrap: wrap; }
.cookie-banner p { font-size: .85rem; flex: 1; }
.cookie-banner a { color: var(--accent); }
.cookie-btns { display: flex; gap: .5rem; }
.btn-primary { background: var(--accent); color: #fff; border: none; padding: .5rem 1.1rem; border-radius: 999px; font-weight: 800; font-size: .85rem; cursor: pointer; font-family: inherit; transition: background .2s; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border: 1.5px solid rgba(255,255,255,.3); padding: .5rem 1.1rem; border-radius: 999px; font-weight: 700; font-size: .85rem; cursor: pointer; font-family: inherit; }

/* --- Footer --- */
.site-footer { background: var(--primary-dark); color: rgba(255,255,255,.7); padding: 2.5rem 1.5rem; }
.footer-inner { max-width: 1140px; margin: 0 auto; text-align: center; }
.footer-logo { display: flex; align-items: center; justify-content: center; gap: .5rem; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.1rem; color: #fff; margin-bottom: 1rem; }
.footer-logo span { color: var(--accent); }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.footer-links a { color: rgba(255,255,255,.65); text-decoration: none; font-size: .85rem; }
.footer-links a:hover { color: var(--accent); }
.footer-disclaimer { font-size: .78rem; max-width: 700px; margin: 0 auto .75rem; line-height: 1.6; }
.footer-copy { font-size: .75rem; opacity: .5; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  .result-grid-3 { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.7rem; }
  .add-item-row { flex-direction: column; }
}
@media (max-width: 480px) {
  .result-grid-3 { grid-template-columns: 1fr; }
}
