/* ============================================================
   Client Portal — Ramaker & Associates
   client.css
   ============================================================ */

:root {
  --sidebar-bg:    #06243a;
  --sidebar-text:  rgba(255,255,255,0.68);
  --sidebar-hover: rgba(255,255,255,0.06);
  --sidebar-active-bg: rgba(212,137,10,0.18);
  --sidebar-active-text: #f0a833;
  --sidebar-border: rgba(255,255,255,0.08);
  --sidebar-width: 230px;

  --accent:     #d4890a;
  --accent-dark:#b5720a;

  --bg:     #f0f5f9;
  --card:   #ffffff;
  --border: #dde8f0;
  --text:   #0d1f2d;
  --muted:  #5a7080;

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 4px rgba(9,54,83,0.07), 0 4px 16px rgba(9,54,83,0.06);
}

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

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login ───────────────────────────────────────────────── */
#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(145deg, #06243a 0%, #0d3a58 100%);
}

.lv-card {
  background: var(--card);
  border-radius: 18px;
  padding: 40px 40px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.lv-logo-wrap {
  margin-bottom: 20px;
}
.lv-logo {
  height: 44px;
  display: block;
  border-radius: 4px;
}

.lv-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.lv-subtitle {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 28px;
}

.lv-field {
  margin-bottom: 18px;
}
.lv-field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.lv-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.lv-field input:focus { border-color: var(--accent); }
.lv-field input.error { border-color: #dc2626; }

.lv-pw-wrap {
  position: relative;
}
.lv-pw-wrap input { padding-right: 60px; }
.lv-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 4px;
}
.lv-pw-toggle:hover { color: var(--accent); }

.lv-field-hint {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 5px;
}

.lv-error {
  font-size: .85rem;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
}
.lv-error.hidden { display: none; }

.lv-btn {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  margin-top: 4px;
}
.lv-btn:hover   { background: var(--accent-dark); }
.lv-btn:disabled { opacity: .6; cursor: not-allowed; }

.lv-footer-note {
  margin-top: 24px;
  font-size: .78rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}
.lv-footer-note a { color: var(--accent); }

/* ── Portal Layout ───────────────────────────────────────── */
#portal-view { height: 100vh; overflow: hidden; }
.cp-layout {
  display: flex;
  height: 100%;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.cp-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cp-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.cp-brand-logo {
  height: 38px;
  display: block;
  border-radius: 4px;
}

.cp-client-info {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.cp-client-cemetery {
  font-size: .88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.90);
  line-height: 1.35;
  margin-bottom: 3px;
}
.cp-client-name {
  font-size: .78rem;
  color: var(--sidebar-text);
}

.cp-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
}
.cp-nav-item {
  display: block;
  padding: 11px 20px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--sidebar-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.cp-nav-item:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,0.90);
  text-decoration: none;
}
.cp-nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left-color: var(--sidebar-active-text);
  font-weight: 600;
}

.cp-sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--sidebar-border);
  padding: 16px 20px;
}
.cp-sidebar-contact {
  margin-bottom: 14px;
}
.cp-contact-name {
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.cp-contact-title {
  font-size: .72rem;
  color: var(--sidebar-text);
  line-height: 1.5;
}
.cp-contact-phone {
  font-size: .78rem;
  color: var(--sidebar-active-text);
  text-decoration: none;
  display: block;
  margin-top: 3px;
}
.cp-contact-phone:hover { text-decoration: underline; }

.cp-signout-btn {
  width: 100%;
  padding: 8px 0;
  background: none;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: .8rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.cp-signout-btn:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}

/* ── Main Content ─────────────────────────────────────────── */
.cp-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cp-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}
.cp-panel.hidden { display: none; }

.cp-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
  gap: 16px;
}
.cp-panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.cp-panel-sub {
  font-size: .82rem;
  color: var(--muted);
}

.cp-open-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.cp-open-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.cp-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cp-pdf-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s;
}
.cp-pdf-btn:hover {
  opacity: .88;
  text-decoration: none;
  color: #ffffff;
}

/* ── Iframe panels ────────────────────────────────────────── */
.cp-iframe-wrap {
  flex: 1;
  overflow: hidden;
  background: #e8eef4;
}
.cp-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

/* ── Mobile App Panel ─────────────────────────────────────── */
.cp-app-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
}

.cp-app-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.cp-app-card-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 6px;
}
.cp-app-cemetery-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.cp-app-desc {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}
.cp-app-launch-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: background .15s;
}
.cp-app-launch-btn:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

.cp-app-credentials {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.cp-cred-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 14px;
}
.cp-cred-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.cp-cred-row:last-of-type { border-bottom: none; }
.cp-cred-key {
  font-size: .82rem;
  color: var(--muted);
  font-weight: 500;
  min-width: 90px;
}
.cp-cred-val {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'Courier New', monospace;
  word-break: break-all;
}
.cp-cred-note {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

/* ── Utility ──────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 680px) {
  .cp-sidebar { width: 200px; }
  .cp-panel-header { flex-direction: column; align-items: flex-start; }
  .cp-app-content { padding: 16px; }
  .lv-card { padding: 28px 20px 24px; }
}
@media (max-width: 480px) {
  .cp-layout { flex-direction: column; }
  .cp-sidebar { width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; }
  .cp-nav { display: flex; flex-direction: row; padding: 0; overflow-x: auto; }
  .cp-nav-item { padding: 12px 16px; border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .cp-nav-item.active { border-bottom-color: var(--sidebar-active-text); border-left-color: transparent; }
  .cp-brand, .cp-client-info, .cp-sidebar-footer { display: none; }
}

/* ── Proposal Update Banner ─────────────────────────────── */
#update-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #1a4d2e;
  color: #fff;
  padding: 12px 20px;
  font-size: .9rem;
  flex-wrap: wrap;
}
#update-banner span { flex: 1; min-width: 200px; }
#update-banner button {
  background: #fff;
  color: #1a4d2e;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-size: .85rem;
}
#update-banner button:hover { background: #e8f5e9; }
