/* Elevate Edits Portal - dashboard shell (client + admin) */
:root {
  --brand: #5b2cff;
  --brand-light: #8b6bff;
  --bg: #0b0710;
  --surface: #17132b;
  --surface-2: #1e1938;
  --border: rgba(139,107,255,0.22);
  --text: #f4f2fb;
  --text-dim: #b6aed6;
  --text-mute: #8b83ab;
  --radius: 14px;
  --ok: #35d488;
  --warn: #ffb84d;
  --danger: #ff5c7a;
  --info: #4da3ff;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background:
    radial-gradient(ellipse 1200px 900px at -5% 0%, rgba(139,107,255,0.35), transparent 62%),
    radial-gradient(ellipse 1000px 700px at 100% 0%, rgba(91,44,255,0.22), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
p { color: var(--text-dim); }

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

.portal-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(35,18,70,0.75), rgba(11,7,16,0.9));
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.portal-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; padding: 4px 8px 22px; }
.portal-brand img { height: 30px; width: 30px; border-radius: 8px; object-fit: cover; }
.portal-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-dim); font-weight: 600; font-size: 0.93rem;
  margin-bottom: 2px;
}
.portal-nav a:hover { background: rgba(139,107,255,0.1); color: var(--text); }
.portal-nav a.active { background: linear-gradient(120deg, rgba(139,107,255,0.28), rgba(91,44,255,0.18)); color: var(--text); border: 1px solid var(--border); }
.portal-sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.portal-sidebar-footer .user-name { font-weight: 700; font-size: 0.9rem; }
.portal-sidebar-footer .user-email { color: var(--text-mute); font-size: 0.78rem; word-break: break-all; }
.portal-sidebar-footer a.logout { display:block; margin-top:10px; color: var(--danger); font-weight:600; font-size:0.85rem; }

.portal-main { flex: 1; padding: 30px 34px; max-width: 1100px; }
.portal-main h1 { font-size: 1.6rem; margin: 0 0 6px; }
.portal-sub { color: var(--text-mute); margin-bottom: 26px; }

.card {
  background: linear-gradient(180deg,#100c1e,#0a0712);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 16px 40px rgba(91,44,255,0.10), inset 0 1px 0 rgba(255,255,255,0.03);
  margin-bottom: 20px;
}
.card h3 { margin-top: 0; }

.settings-quick-row { display: flex; gap: 20px; align-items: flex-start; }
.settings-quick-row > .card { flex: 1 1 0; min-width: 0; margin-bottom: 0; }
@media (max-width: 900px) {
  .settings-quick-row { flex-direction: column; }
  .settings-quick-row > .card { margin-bottom: 20px; }
}

.client-view-top { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; margin-bottom: 20px; }
.client-view-side { display: flex; flex-direction: column; gap: 20px; }
.client-view-side > .card, .client-view-top > .card { margin-bottom: 0; }
@media (max-width: 1000px) {
  .client-view-top { grid-template-columns: 1fr; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 0.92rem;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: linear-gradient(120deg, #8b6bff, var(--brand) 55%, #4a1fd9); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: transparent; border-color: var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--brand-light); color: var(--brand-light); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-google {
  background: #fff; color: #3c4043; border-color: #dadce0;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif; font-weight: 600;
}
.btn-google:hover { background: #f8f9fa; border-color: #c6c9cc; }
.btn-google svg { flex-shrink: 0; }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 0.95rem; font-family: inherit;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--brand-light);
}
.form-field input:disabled { opacity: 0.65; cursor: not-allowed; }
.form-field textarea { min-height: 110px; resize: vertical; }
.field-hint { font-size: 0.78rem; color: var(--text-mute); margin-top: 6px; }

.pw-toggle-wrap { position: relative; }
.pw-toggle-wrap input { padding-right: 42px; }
.pw-toggle-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  border-radius: 8px;
}
.pw-toggle-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.field-error { color: var(--danger); font-size: 0.85rem; margin-bottom: 14px; }

.otp-boxes { display: flex; gap: 10px; justify-content: space-between; }
.otp-box {
  width: 100%; aspect-ratio: 1; min-width: 0; padding: 0;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 1.4rem; font-weight: 700; text-align: center;
  font-family: inherit;
}
.otp-box:focus { outline: none; border-color: var(--brand-light); }
.form-alert { background: rgba(255,92,122,0.1); border: 1px solid rgba(255,92,122,0.35); color: #ffb3c1; padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; font-size: 0.9rem; }
.form-success { background: rgba(53,212,136,0.1); border: 1px solid rgba(53,212,136,0.35); color: #a8f0cf; padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; font-size: 0.9rem; }

/* password strength meter */
.pw-meter { height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.pw-meter-bar { height: 100%; width: 0%; background: var(--danger); transition: width 0.2s ease, background 0.2s ease; }
.pw-rules { list-style: none; padding: 0; margin: 10px 0 0; font-size: 0.78rem; color: var(--text-mute); display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.pw-rules li::before { content: "○ "; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { content: "✓ "; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data-table th { text-align: left; color: var(--text-mute); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.data-table td { padding: 12px; border-bottom: 1px solid rgba(139,107,255,0.08); }
table.data-table tr:hover td { background: rgba(139,107,255,0.05); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-pending-payment { background: rgba(255,122,61,0.16); color: #ff7a3d; }
.badge-active { background: rgba(53,212,136,0.15); color: var(--ok); }
.badge-paused { background: rgba(255,184,77,0.15); color: var(--warn); }
.badge-cancelled { background: rgba(255,92,122,0.15); color: var(--danger); }
.badge-delivered { background: rgba(77,163,255,0.16); color: var(--info); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-mute); }

/* auth pages: split layout with testimonial side panel */
.auth-shell { display: flex; min-height: 100vh; }
.auth-side {
  flex: 0 0 42%;
  max-width: 560px;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(ellipse 900px 700px at 10% 0%, rgba(139,107,255,0.5), transparent 60%),
    linear-gradient(160deg, #2a1660, #120a2e 70%);
  position: relative;
  overflow: hidden;
}
.auth-side-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; margin-bottom: 40px; }
.auth-side-brand img { height: 32px; width: 32px; border-radius: 9px; object-fit: cover; }
.auth-side h1 { font-size: 2.1rem; line-height: 1.15; margin: 0 0 14px; }
.auth-side p { font-size: 1rem; max-width: 400px; }
.auth-testi { margin-top: 46px; background: rgba(11,7,16,0.45); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(6px); }
.auth-testi-slide { display: none; }
.auth-testi-slide.active { display: block; animation: auth-testi-fade 0.4s ease; }
@keyframes auth-testi-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.auth-testi-stars { color: #ffcf5c; letter-spacing: 2px; margin-bottom: 10px; font-size: 0.9rem; }
.auth-testi-slide p { color: var(--text); font-size: 0.94rem; line-height: 1.5; margin: 0 0 16px; max-width: none; }
.auth-testi-person { display: flex; align-items: center; gap: 12px; }
.auth-testi-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-light), var(--brand)); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; flex-shrink: 0; }
.auth-testi-person strong { display: block; font-size: 0.88rem; }
.auth-testi-person span { display: block; font-size: 0.78rem; color: var(--text-mute); }
.auth-testi-dots { display: flex; gap: 6px; margin-top: 18px; }
.auth-testi-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.2); transition: background 0.2s ease, width 0.2s ease; }
.auth-testi-dots span.active { background: var(--brand-light); width: 18px; border-radius: 4px; }

.auth-form-col { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form-col > div { width: 100%; max-width: 420px; }

@media (max-width: 900px) {
  .auth-shell { flex-direction: column; }
  .auth-side { max-width: none; flex: none; padding: 36px 26px; }
  .auth-testi { margin-top: 28px; }
}

/* unread message badge */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  margin-left: 7px;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(255,59,48,0.25);
}
.data-row-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  margin-left: 8px;
}

/* chat */
.chat-participants { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chat-participant-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 12px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-dim);
}
.chat-participant-chip button {
  width: 18px; height: 18px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.08); color: var(--text-mute);
  font-size: 0.85rem; line-height: 1; cursor: pointer;
}
.chat-participant-chip button:hover { background: var(--danger); color: #fff; }
.chat-wrap { display: flex; flex-direction: column; height: 78vh; max-height: 820px; min-height: 460px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble-msg { max-width: 70%; padding: 10px 14px; border-radius: 14px; font-size: 0.92rem; line-height: 1.4; }
.chat-bubble-msg.mine { align-self: flex-end; background: linear-gradient(120deg, #8b6bff, var(--brand) 60%); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble-msg.theirs { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-bubble-msg .meta { display:block; font-size: 0.68rem; opacity: 0.7; margin-top: 4px; }
.chat-input-row { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-input-row textarea { flex: 1; resize: none; height: 44px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: inherit; }
.chat-attach-btn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 1.1rem; flex-shrink: 0;
}
.chat-attach-btn:hover { border-color: var(--brand-light); }
.chat-attach-btn input[type="file"] { display: none; }
.chat-file-preview {
  padding: 0 14px 12px; font-size: 0.8rem; color: var(--text-mute); display: flex; align-items: center; gap: 8px; min-height: 0;
}
.chat-file-preview:empty { display: none; }
.chat-file-preview .remove-file { color: var(--danger); cursor: pointer; font-weight: 700; }
.chat-attachment-img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; margin-top: 6px; object-fit: cover; }
.chat-attachment-file { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,0.06); font-size: 0.85rem; }

/* toast notification */
/* Profile photo + crop modal */
.profile-photo-row { display: flex; align-items: center; gap: 20px; }
.profile-photo-preview {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border); background: var(--surface-2); flex-shrink: 0;
}
.profile-photo-trigger { cursor: pointer; }
.profile-photo-trigger input[type="file"] { display: none; }

.crop-overlay {
  display: none; position: fixed; inset: 0; background: rgba(5,3,10,0.85);
  z-index: 600; align-items: center; justify-content: center; padding: 20px;
}
.crop-overlay.open { display: flex; }
.crop-dialog {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 380px; text-align: center;
}
.crop-dialog h3 { margin: 0 0 6px; }
.crop-hint { font-size: 0.82rem; color: var(--text-mute); margin: 0 0 16px; }
.crop-viewport {
  width: 300px; height: 300px; max-width: 100%; margin: 0 auto 16px;
  border-radius: 50%; overflow: hidden; position: relative; cursor: grab;
  background: #000; border: 2px solid var(--border);
  touch-action: none;
}
.crop-viewport:active { cursor: grabbing; }
.crop-image { position: absolute; top: 0; left: 0; user-select: none; pointer-events: none; max-width: none; }
.crop-zoom { width: 100%; margin-bottom: 18px; }
.crop-actions { display: flex; gap: 10px; }
.crop-actions .btn { flex: 1; }

.toast-stack { position: fixed; top: 20px; right: 20px; z-index: 500; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: linear-gradient(135deg, #2a1660, #150a35);
  border: 1px solid var(--border);
  border-left: 4px solid #ff3b30;
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 240px;
  max-width: 320px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  animation: toast-in 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.hide { animation: toast-out 0.3s ease forwards; }
.toast-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff3b30; flex-shrink: 0; box-shadow: 0 0 0 4px rgba(255,59,48,0.2); }
.toast-text { font-size: 0.88rem; font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(30px); } }

.topbar-mobile { display: none; }
@media (max-width: 860px) {
  .portal-shell { flex-direction: column; }
  .portal-sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; padding: 12px; }
  .portal-nav { display: flex; flex-direction: row; gap: 4px; }
  .portal-sidebar-footer { display: none; }
  .portal-main { padding: 20px; }
}
