/* Customer Portal — softer, more editorial than the CRM */
@import url("colors_and_type.css");

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  background: var(--ink-50);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.portal { min-height: 100vh; display: flex; flex-direction: column; }

/* ============ TOP BAR (full-width) ============ */
.ptopbar {
  height: 64px; background: #fff;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; padding: 0 32px; gap: 24px;
  position: sticky; top: 0; z-index: 5;
}
.ptopbar .brand { display: flex; align-items: center; gap: 10px; }
.ptopbar .brand .wm { font-weight: 700; letter-spacing: 0.18em; font-size: 14px; color: var(--brand-ink); }
.ptopbar .brand .sub { font-size: 9px; letter-spacing: 0.22em; color: var(--brand-burgundy); margin-top: 1px; }
.ptopbar nav { display: flex; gap: 4px; margin-left: 24px; }
.ptopbar nav a {
  padding: 8px 14px; font-size: 13.5px; color: var(--fg-2); text-decoration: none;
  border-radius: 6px; cursor: pointer; font-weight: 500;
}
.ptopbar nav a:hover { background: var(--ink-50); color: var(--fg-1); }
.ptopbar nav a.active { background: var(--plum-50); color: var(--brand-burgundy); }
.ptopbar-spacer { flex: 1; }
.ptopbar .icon-btn { width: 36px; height: 36px; border-radius: 6px; display:flex; align-items:center; justify-content:center; background:transparent; border:0; cursor:pointer; color:var(--fg-2); position: relative; }
.ptopbar .icon-btn:hover { background: var(--ink-100); }
.ptopbar .icon-btn .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; background: var(--brand-magenta); border-radius: 999px; border: 2px solid #fff; }

/* ============ HERO ============ */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--plum-900), var(--plum-700));
  color: #fff; padding: 44px 32px 60px;
  overflow: hidden;
}
.hero .inner { max-width: var(--content-max); margin: 0 auto; position: relative; z-index: 1; }
.hero .eyebrow { color: var(--brand-pink); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; }
.hero h1 { font-family: var(--font-display); font-weight: 600; font-size: 42px; letter-spacing: -0.02em; line-height: 1.1; margin: 8px 0 6px; }
.hero p  { font-size: 16px; color: rgba(244, 221, 232, 0.85); max-width: 540px; margin: 0; line-height: 1.5; }
.hero .ring-bg { position: absolute; right: -120px; top: -80px; opacity: 0.12; color: #F5989D; }
.hero .ring-bg-2 { position: absolute; left: -60px; bottom: -120px; opacity: 0.08; color: #F5989D; }

/* ============ CONTAINER ============ */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 32px; }
.section { padding: 28px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.section-head .lnk { color: var(--brand-burgundy); font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; }
.section-head .lnk:hover { color: var(--brand-magenta); }

/* ============ CARDS ============ */
.pcard {
  background: #fff; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.pcard-pad { padding: 20px; }

/* Service request card */
.req {
  display: flex; gap: 16px; padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer; transition: background 180ms;
}
.req:hover { background: var(--ink-50); }
.req:last-child { border-bottom: 0; }
.req .ic {
  width: 44px; height: 44px; border-radius: 10px; background: var(--plum-50);
  color: var(--brand-burgundy); display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.req .body { flex: 1; min-width: 0; }
.req .title { font-weight: 600; font-size: 14.5px; }
.req .meta  { color: var(--fg-3); font-size: 12px; margin-top: 2px; }
.req .progress { margin-top: 10px; }

.bar { height: 6px; background: var(--ink-100); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand-burgundy); border-radius: 999px; }
.bar-info > span { background: var(--info-500); }
.bar-success > span { background: var(--success-500); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1.4;
  background: var(--ink-100); color: var(--fg-2);
}
.chip .dot { width: 6px; height: 6px; border-radius: 999px; }
.chip-success { background: var(--success-50); color: var(--success-700); }
.chip-success .dot { background: var(--success-500); }
.chip-info { background: var(--info-50); color: var(--info-700); }
.chip-info .dot { background: var(--info-500); }
.chip-warning { background: var(--warning-50); color: var(--warning-700); }
.chip-warning .dot { background: var(--warning-500); }

/* Service catalogue tile */
.tile {
  background: #fff; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 18px;
  cursor: pointer; transition: all 180ms;
  display: flex; flex-direction: column; gap: 8px; min-height: 132px;
}
.tile:hover { border-color: var(--brand-burgundy); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tile .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--plum-50); color: var(--brand-burgundy); display: flex; align-items: center; justify-content: center; }
.tile .ttl { font-size: 14px; font-weight: 600; }
.tile .desc { font-size: 12px; color: var(--fg-3); line-height: 1.45; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: 13.5px; font-weight: 500; border-radius: 6px; padding: 9px 16px; cursor: pointer; border: 1px solid transparent; transition: all 180ms; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand-burgundy); color: #fff; }
.btn-primary:hover { background: var(--plum-700); box-shadow: var(--shadow-brand); }
.btn-secondary { background: #fff; color: var(--fg-1); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--ink-50); }
.btn-ghost { background: transparent; color: var(--brand-burgundy); }
.btn-ghost:hover { background: var(--plum-50); }
.btn-light { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.25); }
.btn-light:hover { background: rgba(255,255,255,0.2); }

/* Timeline (vertical step) */
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 14px; padding: 12px 0; position: relative; }
.step .node {
  width: 28px; height: 28px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid var(--ink-300); color: var(--fg-3); flex-shrink: 0;
  font-size: 11px; font-weight: 700;
  z-index: 1;
}
.step.done .node { background: var(--success-500); border-color: var(--success-500); color: #fff; }
.step.current .node { background: var(--brand-burgundy); border-color: var(--brand-burgundy); color: #fff; }
.step::after {
  content: ""; position: absolute; left: 13px; top: 38px; bottom: -10px; width: 2px;
  background: var(--ink-200);
}
.step:last-child::after { display: none; }
.step.done::after { background: var(--success-500); }
.step .body { padding-top: 3px; flex: 1; }
.step .title { font-size: 14px; font-weight: 600; }
.step .meta { font-size: 12px; color: var(--fg-3); margin-top: 2px; }

/* ============ FORMS ============ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--fg-2); }
.field input, .field select, .field textarea {
  font-family: var(--font-sans); font-size: 13.5px;
  padding: 9px 12px; border: 1px solid var(--border-strong);
  border-radius: 6px; background: #fff; color: var(--fg-1); outline: none;
  transition: all 180ms;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-burgundy);
  box-shadow: 0 0 0 3px rgba(111,25,71,0.12);
}

/* ============ SCRIM + MODAL ============ */
.scrim {
  position: fixed; inset: 0; background: rgba(35,31,32,0.48);
  z-index: 50; animation: pfade 200ms ease;
}
@keyframes pfade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 520px; max-width: calc(100vw - 32px); max-height: calc(100vh - 64px);
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(35,31,32,0.18); z-index: 51;
  display: flex; flex-direction: column;
  animation: pmodalIn 220ms cubic-bezier(.4,0,.2,1);
}
@keyframes pmodalIn { from { opacity:0; transform:translate(-50%,-48%) scale(0.97) } to { opacity:1; transform:translate(-50%,-50%) scale(1) } }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 22px 24px 18px; border-bottom: 1px solid var(--border-subtle);
}
.modal-body {
  padding: 22px 24px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
}
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  border-top: 1px solid var(--border-subtle); padding-top: 16px;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer; color: var(--fg-2);
  transition: all 180ms;
}
.icon-btn:hover { background: var(--ink-100); color: var(--fg-1); }

/* Notifications card */
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); align-items: flex-start; }
.notif:last-child { border-bottom: 0; }
.notif .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--brand-magenta); margin-top: 6px; flex-shrink: 0; }
.notif.read .dot { background: var(--ink-300); }
.notif .body { flex: 1; }
.notif .ttl { font-size: 13.5px; font-weight: 500; }
.notif .meta { font-size: 11.5px; color: var(--fg-3); margin-top: 2px; }

/* ============ RESPONSIVE ============ */

/* helpers — overridden by media queries below */
.resp-grid-3 { display: grid; }
.resp-two-col { display: grid; }

@media (max-width: 768px) {
  /* Login panels */
  .login-hero { display: none !important; }
  .login-form-panel { width: 100% !important; padding: 40px 24px !important; }

  /* Topbar — nav wraps to second row */
  .ptopbar {
    height: auto; min-height: 56px;
    flex-wrap: wrap; padding: 0 16px; gap: 0;
  }
  .ptopbar .brand { padding: 10px 0; flex: 1; }
  .ptopbar-spacer { display: none; }
  .ptopbar nav {
    order: 10; width: calc(100% + 32px); margin: 0 -16px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    border-top: 1px solid var(--border-subtle);
    padding: 0 16px; gap: 0; margin-left: -16px;
  }
  .ptopbar nav::-webkit-scrollbar { display: none; }
  .ptopbar nav a { padding: 10px 12px; font-size: 13px; white-space: nowrap; border-radius: 0; }
  .ptopbar nav a.active {
    background: transparent; color: var(--brand-burgundy);
    border-bottom: 2px solid var(--brand-burgundy);
  }

  /* Hero */
  .hero { padding: 28px 20px 36px; }
  .hero h1 { font-size: 26px !important; }
  .hero p { font-size: 14px; max-width: 100%; }
  .hero .ring-bg, .hero .ring-bg-2 { display: none; }

  /* Container & layout */
  .container { padding: 0 16px !important; }
  .section { padding: 20px 0; }
  .section-head { flex-direction: column; align-items: flex-start !important; gap: 8px !important; }

  /* Responsive grids */
  .resp-grid-3 { grid-template-columns: 1fr 1fr !important; }
  .resp-two-col { grid-template-columns: 1fr !important; }

  /* Service request rows */
  .req { padding: 14px 16px; }
  .req .progress { margin-top: 8px; }

  /* Tiles */
  .tile { min-height: 110px; }

  /* Modals */
  .modal { width: calc(100vw - 24px) !important; max-height: calc(100vh - 32px) !important; }

  /* Steps (service detail) */
  .steps .step .meta { font-size: 11.5px; }

  /* Chips */
  .chip { font-size: 11px; padding: 2px 8px; }
}

@media (max-width: 480px) {
  .resp-grid-3 { grid-template-columns: 1fr !important; }
  .ptopbar .icon-btn { width: 30px; height: 30px; }
  .hero h1 { font-size: 22px !important; }
  .btn { font-size: 13px; padding: 8px 12px; }
}
