/* ==========================================================
   iSerb — App Design System
   Priority: simple, professional, and easy to use for people
   who are not tech-savvy (senior citizens, farmers). That means:
   large text, large tap targets, high contrast, icon + label
   together (never icon-only), minimal steps per screen.
   ========================================================== */

:root{
  --navy-deep:#001330;
  --navy:#00204b;
  --teal:#056485;
  --cyan:#12a5c9;
  --cyan-light:#5fd4ec;
  --paper:#f4f8fa;
  --paper-2:#e9f1f4;
  --ink:#0b1b2b;
  --steel:#4a5d70;
  --line:rgba(11,27,43,0.12);
  --success:#1a8a4a;
  --success-bg:#e6f6ec;
  --warn:#b5760a;
  --warn-bg:#fdf1de;
  --danger:#c0392b;
  --danger-bg:#fdecea;

  --radius:16px;
  --radius-sm:10px;
  --shadow:0 10px 26px -14px rgba(0,32,75,0.28);
  --shadow-lg:0 18px 40px -18px rgba(0,32,75,0.35);

  --ff-display:'Sora',sans-serif;
  --ff-body:'Inter',sans-serif;

  /* Base sizing is intentionally larger than typical web defaults. */
  --fs-base:17px;
  --tap-min:52px;
}

*,*::before,*::after{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%;}
body{
  margin:0;
  font-family:var(--ff-body);
  font-size:var(--fs-base);
  line-height:1.5;
  color:var(--ink);
  background:var(--paper-2);
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;display:block;}
a{color:inherit;text-decoration:none;}
button{font-family:inherit;}
ul{margin:0;padding:0;list-style:none;}
h1,h2,h3,h4{font-family:var(--ff-display);color:var(--navy);margin:0;line-height:1.2;}

:focus-visible{outline:3px solid var(--cyan);outline-offset:2px;border-radius:6px;}

/* App shell: mobile-first, centered on wider screens like a phone frame */
.app{
  max-width:520px;
  margin:0 auto;
  min-height:100vh;
  background:var(--paper);
  display:flex;
  flex-direction:column;
  position:relative;
}
.app-body{
  flex:1;
  padding:20px 20px 100px;
}
.app-body.no-bottom-pad{padding-bottom:20px;}

/* ---------------- Top bar ---------------- */
.topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 20px;
  background:#fff;
  border-bottom:1px solid var(--line);
  position:sticky;top:0;z-index:20;
}
.topbar-logo{display:flex;align-items:center;gap:10px;}
.topbar-logo img{height:32px;width:auto;}
.topbar-back{
  display:flex;align-items:center;justify-content:center;
  width:var(--tap-min);height:var(--tap-min);
  margin-left:-14px;
  color:var(--navy);
}
.topbar-back svg{width:24px;height:24px;}
.topbar-title{font-family:var(--ff-display);font-size:20px;font-weight:700;color:var(--navy);}

/* ---------------- Buttons ---------------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  width:100%;
  min-height:var(--tap-min);
  padding:14px 22px;
  border-radius:999px;
  border:1px solid transparent;
  font-family:var(--ff-body);
  font-size:17px;
  font-weight:700;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn svg{width:20px;height:20px;flex-shrink:0;}
.btn-primary{
  background:linear-gradient(135deg,var(--cyan),var(--teal));
  color:#fff;
  box-shadow:0 10px 22px -10px rgba(18,165,201,0.55);
}
.btn-primary:hover{transform:translateY(-1px);}
.btn-primary:active{transform:translateY(0);}
.btn-secondary{
  background:#fff;color:var(--navy);
  border-color:var(--line);
}
.btn-secondary:hover{border-color:var(--navy);}
.btn-outline-light{
  background:transparent;color:#fff;border-color:rgba(255,255,255,0.55);
}
.btn-ghost{
  background:transparent;color:var(--teal);
  min-height:auto;padding:10px 6px;font-weight:700;
  width:auto;
}
.btn-block-group{display:flex;flex-direction:column;gap:12px;}
.btn:disabled{opacity:0.55;cursor:not-allowed;}

/* ---------------- Form elements ---------------- */
.field{margin-bottom:20px;}
.field label{
  display:block;
  font-weight:700;
  font-size:15.5px;
  color:var(--navy);
  margin-bottom:8px;
}
.field .hint{font-size:13.5px;color:var(--steel);margin-top:6px;}
.field .req{color:var(--danger);}
.input,
.select,
.textarea{
  width:100%;
  min-height:var(--tap-min);
  padding:13px 16px;
  font-size:16.5px;
  font-family:var(--ff-body);
  color:var(--ink);
  background:#fff;
  border:1.5px solid var(--line);
  border-radius:var(--radius-sm);
  transition:border-color .15s ease, box-shadow .15s ease;
}
.textarea{min-height:110px;resize:vertical;line-height:1.5;padding-top:13px;}
.input:focus,.select:focus,.textarea:focus{
  border-color:var(--cyan);
  box-shadow:0 0 0 4px rgba(18,165,201,0.15);
  outline:none;
}
.input.has-error,.select.has-error{border-color:var(--danger);}
.error-text{color:var(--danger);font-size:14px;margin-top:6px;font-weight:600;}
.select-wrap{position:relative;}
.select{appearance:none;-webkit-appearance:none;padding-right:44px;}
.select-wrap::after{
  content:"";position:absolute;right:16px;top:50%;
  width:11px;height:11px;
  border-right:2.5px solid var(--steel);border-bottom:2.5px solid var(--steel);
  transform:translateY(-65%) rotate(45deg);
  pointer-events:none;
}
.input-with-icon{position:relative;}
.input-with-icon .input{padding-left:46px;}
.input-with-icon svg{
  position:absolute;left:5px;top:50%;transform:translateY(-50%);
  width:20px;height:20px;color:var(--steel);
}
.password-toggle{
  position:absolute;right:6px;top:50%;transform:translateY(-50%);
  width:40px;height:40px;
  display:flex;align-items:center;justify-content:center;
  color:var(--steel);
  background:transparent;
  border:none;
  padding:0;
  cursor:pointer;
  border-radius:8px;
}
.password-toggle:hover{color:var(--teal);}
.checkbox-row{
  display:flex;align-items:flex-start;gap:12px;
  padding:4px 0;
}
.checkbox-row input[type="checkbox"]{
  width:24px;height:24px;flex-shrink:0;accent-color:var(--cyan);margin-top:1px;
}
.checkbox-row label{font-size:15px;color:var(--ink);font-weight:500;line-height:1.5;}
.checkbox-row a{color:var(--teal);font-weight:700;text-decoration:underline;}

/* ---------------- Cards ---------------- */
.card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:22px;
  box-shadow:var(--shadow);
}

/* ---------------- Role select cards (registration) ---------------- */
.role-grid{display:flex;flex-direction:column;gap:16px;}
.role-card{
  display:flex;align-items:center;gap:16px;
  padding:20px;
  background:#fff;
  border:2px solid var(--line);
  border-radius:var(--radius);
  cursor:pointer;
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  text-align:left;
  width:100%;
}
.role-card:hover{border-color:var(--cyan);box-shadow:var(--shadow-lg);transform:translateY(-2px);}
.role-card .role-icon{
  width:58px;height:58px;border-radius:14px;flex-shrink:0;
  background:linear-gradient(135deg,rgba(5,100,133,0.12),rgba(18,165,201,0.16));
  display:flex;align-items:center;justify-content:center;
}
.role-card .role-icon svg{width:30px;height:30px;color:var(--teal);}
.role-card h3{font-size:18.5px;margin-bottom:4px;}
.role-card p{font-size:14.5px;color:var(--steel);margin:0;line-height:1.45;}
.role-card .role-arrow{margin-left:auto;color:var(--steel);flex-shrink:0;}
.role-card .role-arrow svg{width:22px;height:22px;}

/* ---------------- Auth screens ---------------- */
.auth-hero{
  text-align:center;
  padding:8px 0 28px;
}
.auth-hero img{height:52px;margin:0 auto 18px;}
.auth-hero h1{font-size:24px;margin-bottom:8px;}
.auth-hero p{color:var(--steel);font-size:15.5px;margin:0;}
.auth-footer{
  text-align:center;
  margin-top:26px;
  font-size:15px;
  color:var(--steel);
}
.auth-footer a{color:var(--teal);font-weight:700;}

.progress-steps{
  display:flex;align-items:center;gap:6px;
  margin-bottom:26px;
}
.progress-steps .seg{
  flex:1;height:6px;border-radius:999px;background:var(--line);
}
.progress-steps .seg.done{background:linear-gradient(90deg,var(--teal),var(--cyan));}

/* ---------------- Alerts / flash ---------------- */
.alert{
  display:flex;gap:12px;align-items:flex-start;
  padding:14px 16px;border-radius:var(--radius-sm);
  font-size:15px;font-weight:600;margin-bottom:16px;
  border:1px solid transparent;
}
.alert svg{width:20px;height:20px;flex-shrink:0;margin-top:1px;}
.alert-error{background:var(--danger-bg);color:var(--danger);border-color:rgba(192,57,43,0.25);}
.alert-success{background:var(--success-bg);color:var(--success);border-color:rgba(26,138,74,0.25);}
.alert-warn{background:var(--warn-bg);color:var(--warn);border-color:rgba(181,118,10,0.25);}

/* ---------------- Home / dashboard: search ---------------- */
.home-search{
  display:flex;gap:10px;margin-bottom:20px;
}
.search-box{
  flex:1;
  display:flex;align-items:center;gap:10px;
  background:#fff;border:1.5px solid var(--line);
  border-radius:999px;padding:0 16px;
  min-height:var(--tap-min);
}
.search-box svg{width:20px;height:20px;color:var(--steel);flex-shrink:0;}
.search-box input{
  border:none;outline:none;background:transparent;
  font-size:16px;width:100%;font-family:var(--ff-body);color:var(--ink);
  min-height:var(--tap-min);
}
.search-box input::placeholder{color:#9aacbb;}

/* ---------------- Category / feature card ---------------- */
.section-title{
  display:flex;align-items:center;justify-content:space-between;
  margin:26px 0 14px;
}
.section-title h2{font-size:19px;}
.section-title a{font-size:14.5px;font-weight:700;color:var(--teal);}

.category-card{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  padding:22px;box-shadow:var(--shadow);
}
.category-card-head{display:flex;gap:14px;align-items:flex-start;margin-bottom:18px;}
.category-card-head .icon{
  width:52px;height:52px;border-radius:14px;flex-shrink:0;
  background:linear-gradient(135deg,rgba(5,100,133,0.12),rgba(18,165,201,0.16));
  display:flex;align-items:center;justify-content:center;
}
.category-card-head .icon svg{width:28px;height:28px;color:var(--teal);}
.category-card-head h3{font-size:19px;margin-bottom:4px;}
.category-card-head p{font-size:14px;color:var(--steel);margin:0;}

.subcat-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:18px;
}
.subcat-item{
  display:flex;flex-direction:column;align-items:center;gap:8px;
  padding:16px 6px;
  background:var(--paper-2);
  border-radius:var(--radius-sm);
  text-align:center;
  border:1.5px solid transparent;
  transition:border-color .15s ease, background .15s ease;
  min-height:var(--tap-min);
  justify-content:center;
}
.subcat-item:hover{border-color:var(--cyan);background:#fff;}
.subcat-item .subcat-icon{
  width:34px;height:34px;
  display:flex;align-items:center;justify-content:center;
}
.subcat-item .subcat-icon svg{width:24px;height:24px;color:var(--teal);}
.subcat-item span{font-size:13.5px;font-weight:700;color:var(--navy);line-height:1.25;}

/* ---------------- Quick actions grid ---------------- */
.quick-grid{
  display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-bottom:8px;
}
.quick-card{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  padding:18px;box-shadow:var(--shadow);
  display:flex;flex-direction:column;gap:10px;
  min-height:120px;
}
.quick-card .icon{
  width:44px;height:44px;border-radius:12px;
  background:linear-gradient(135deg,rgba(5,100,133,0.12),rgba(18,165,201,0.16));
  display:flex;align-items:center;justify-content:center;
}
.quick-card .icon svg{width:24px;height:24px;color:var(--teal);}
.quick-card strong{font-size:15.5px;color:var(--navy);}
.quick-card span{font-size:13px;color:var(--steel);}

/* ---------------- Stats row (provider dashboard) ---------------- */
.stats-row{
  display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:20px;
}
.stat-box{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:16px 8px;text-align:center;box-shadow:var(--shadow);
}
.stat-box strong{display:block;font-family:var(--ff-display);font-size:22px;color:var(--navy);}
.stat-box span{font-size:12px;color:var(--steel);font-weight:600;}

/* ---------------- Banner (welcome / verification) ---------------- */
.banner{
  border-radius:var(--radius);
  padding:22px;
  color:#fff;
  background:radial-gradient(ellipse 120% 140% at 20% -20%, #0a4970 0%, var(--navy) 55%, var(--navy-deep) 100%);
  margin-bottom:22px;
  position:relative;
  overflow:hidden;
}
.banner h2{color:#fff;font-size:20px;margin-bottom:6px;}
.banner p{color:#c3d7e6;font-size:14.5px;margin:0;line-height:1.5;}
.banner .badge{
  display:inline-flex;align-items:center;gap:6px;
  background:rgba(255,255,255,0.14);
  border:1px solid rgba(255,255,255,0.25);
  padding:6px 12px;border-radius:999px;
  font-size:12.5px;font-weight:700;color:var(--cyan-light);
  margin-bottom:12px;
}
.banner .badge svg{width:14px;height:14px;}

/* ---------------- Bottom navigation ---------------- */
.bottom-nav{
  position:fixed;left:50%;transform:translateX(-50%);bottom:0;
  width:100%;max-width:520px;
  background:#fff;
  border-top:1px solid var(--line);
  display:flex;
  padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index:30;
  box-shadow:0 -8px 24px -18px rgba(0,32,75,0.35);
}
.bottom-nav a{
  flex:1;
  display:flex;flex-direction:column;align-items:center;gap:4px;
  padding:8px 2px;
  color:var(--steel);
  min-height:var(--tap-min);
  border-radius:12px;
}
.bottom-nav a svg{width:23px;height:23px;}
.bottom-nav a span{font-size:11.5px;font-weight:700;}
.bottom-nav a.active{color:var(--teal);}
.bottom-nav a.active svg{color:var(--teal);}

/* ---------------- Empty / placeholder states ---------------- */
.empty-state{
  text-align:center;
  padding:60px 24px;
  color:var(--steel);
}
.empty-state .icon{
  width:72px;height:72px;border-radius:50%;
  background:var(--paper-2);
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 18px;
}
.empty-state .icon svg{width:34px;height:34px;color:var(--teal);}
.empty-state h3{font-size:18px;color:var(--navy);margin-bottom:8px;}
.empty-state p{font-size:14.5px;margin:0 0 20px;}

/* ---------------- Utility ---------------- */
.mt-0{margin-top:0;}
.text-center{text-align:center;}
.stack-sm > * + *{margin-top:10px;}
.stack-md > * + *{margin-top:16px;}

@media (min-width:521px){
  .app{box-shadow:0 0 60px rgba(0,32,75,0.12);}
}
