/* ============================================================
   SONAMASURI DESIGN SYSTEM  v1.0
   css/design-system.css
   ============================================================ */

/* 1. TOKENS */
:root {
  --brand:       #1996E6;
  --brand-dark:  #1278c0;
  --bg:          #f5f7fa;
  --surface:     #ffffff;
  --text:        #0f172a;
  --text-muted:  #64748b;
  --border:      #e5e7eb;
  --radius:      10px;
  --radius-lg:   14px;
  --shadow:      0 2px 12px rgba(15,23,42,.08);
  --shadow-lg:   0 14px 30px rgba(15,23,42,.12);
  --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* 2. RESET / BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 3. LAYOUT */
.my_main {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 4. CARD / PANEL */
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* 5. BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s, box-shadow .15s;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { opacity: .88; box-shadow: 0 4px 12px rgba(0,0,0,.15); text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #0ea5e9);
  color: #fff;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}
.btn-danger {
  background: #dc2626;
  color: #fff;
}
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-full { width: 100%; }

/* 6. FORMS */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.form-label .req { color: #e53e3e; margin-left: 2px; }
.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(25,150,230,.15);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-error {
  display: block;
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  min-height: 1em;
}
.form-hint {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}
/* Radio / checkbox row */
.radio-group {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 8px 0;
}
.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* 7. ALERTS */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}
.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}
.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* 8. TABS */
.sm-tabs { margin-top: 16px; }
.sm-tab-links {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.sm-tab-links a {
  display: inline-block;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s;
  border-radius: 6px 6px 0 0;
}
.sm-tab-links a:hover { color: var(--brand); }
.sm-tab-links a.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: rgba(25,150,230,.05);
}
.sm-tab-pane { display: none; }
.sm-tab-pane.active { display: block; }

/* 9. AUTH PAGES (login / register) */
.auth-logo {
  text-align: center;
  padding: 24px 0 8px;
}
.auth-logo img {
  height: 60px;
  width: auto;
  border-radius: 8px;
  display: inline-block;
}
.auth-wrap {
  max-width: 440px;
  margin: 16px auto 40px;
  width: 100%;
}
.auth-wrap .card { padding: 28px; }
.auth-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}
.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}
.auth-links {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-links a { color: var(--brand); font-weight: 700; }
.auth-error {
  color: #dc2626;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 10px;
}

/* 10. REGISTRATION FIELDSETS */
fieldset.reg-section {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
fieldset.reg-section legend {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  padding: 0 8px;
}
.mandatory-note {
  font-size: 12px;
  color: #dc2626;
  margin-top: 8px;
  text-align: right;
}
/* Conditional sections toggled by JS */
.reg-conditional { display: none; }
.reg-conditional.visible { display: block; }

/* 11. DASHBOARD SHELL */
.dash-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  max-width: 960px;
  margin: 20px auto;
}

/* 12. REFINE-SEARCH LAYOUT */
.rs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  margin: 20px 0;
  align-items: start;
}
.rs-sidebar { /* sticky filter panel */ }
.rs-main { /* product results */ }
.refine-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.refine-item-list {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
}
.refine-item { margin: 4px 0; }
.refine-item a {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.refine-item a:hover { color: var(--brand); }
.refine-item input[type=checkbox] { accent-color: var(--brand); }

/* 13. SEARCH BAR */
.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin: 16px 0;
}
.search-bar input[type=text],
.search-bar input[type=search] {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: transparent;
}

/* 14. RESPONSIVE */
@media (max-width: 768px) {
  .rs-layout { grid-template-columns: 1fr; }
  .rs-sidebar { order: 2; }
  .rs-main { order: 1; }
}
@media (max-width: 600px) {
  .auth-wrap { margin: 12px auto; }
  .auth-wrap .card { padding: 16px; }
  .dash-shell { margin: 12px; padding: 14px; }
}
