/* ============================================================
   PENUELVISION STUDIOS — Client Portal
   Warm beige-brown palette, matching the public site.
   ============================================================ */

:root {
  --bg-deep: #0a0a0f;
  --bg-mid: #12121a;
  --bg-elevated: #1a1a28;

  --beige: #e3c9a8;
  --sand: #c9a87c;
  --brown: #a67c52;
  --on-warm: #2a1f14;

  --gradient: linear-gradient(100deg, #e3c9a8, #c9a87c, #a67c52, #8b6f47, #c9a87c, #e3c9a8);

  --text: #e8e8ef;
  --muted: #9a9aad;
  --border: rgba(255, 255, 255, 0.09);
  --danger: #e07a5f;
  --success: #6bbf8a;

  --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

:focus { outline: 2px solid var(--sand); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

@keyframes warmFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   LOGIN
   ============================================================ */

.pv-login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.pv-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
}

.pv-login-card {
  width: 100%;
  max-width: 430px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.pv-login-brand {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 3.4px;
  color: var(--sand);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 16px;
}

.pv-login-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 8px;
}

.pv-login-sub {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 26px;
}

.pv-field { display: block; margin-bottom: 18px; }

.pv-field-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--text);
  margin-bottom: 7px;
}

.pv-login-form input[type="email"],
.pv-login-form input[type="password"] {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 14px 15px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px; /* 16px stops iOS zooming on focus */
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.pv-login-form input:focus {
  outline: none;
  border-color: var(--sand);
  box-shadow: 0 0 0 3px rgba(201, 168, 124, 0.15);
}

.pv-btn {
  display: inline-block;
  border: none;
  border-radius: 9px;
  padding: 14px 26px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  color: var(--on-warm);
  background-color: var(--brown);
  background-image: var(--gradient);
  background-size: 300% 300%;
  background-position: 0% 50%;
  box-shadow: 0 4px 18px rgba(166, 124, 82, 0.25);
  transition: transform 0.22s, box-shadow 0.3s;
  -webkit-appearance: none;
  appearance: none;
}

.pv-btn:hover {
  animation: warmFlow 4s ease infinite;
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(201, 168, 124, 0.4);
}

.pv-btn-full { width: 100%; margin-top: 4px; }

.pv-btn-ghost {
  background: transparent;
  background-image: none;
  border: 1.5px solid rgba(227, 201, 168, 0.35);
  color: #fff;
  box-shadow: none;
  padding: 9px 18px;
  font-size: 0.8rem;
}

.pv-btn-ghost:hover {
  animation: none;
  transform: none;
  box-shadow: none;
  background: rgba(227, 201, 168, 0.1);
  border-color: var(--beige);
}

.pv-login-foot {
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
  margin-top: 22px;
  line-height: 1.6;
}

.pv-alert {
  border-radius: 9px;
  padding: 12px 15px;
  font-size: 0.86rem;
  margin-bottom: 18px;
  line-height: 1.5;
}

.pv-alert-error {
  background: rgba(224, 122, 95, 0.12);
  border: 1px solid rgba(224, 122, 95, 0.35);
  color: #ffb3a0;
}

/* ============================================================
   DASHBOARD
   ============================================================ */

.pv-portal-header {
  border-bottom: 1px solid var(--border);
  padding: 22px 5vw;
  background: var(--bg-mid);
  position: sticky;
  top: 0;
  z-index: 50;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .pv-portal-header {
    background: rgba(18, 18, 26, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
}

.pv-portal-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pv-portal-brand {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--sand);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.pv-portal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.pv-portal-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pv-portal-name { font-size: 0.86rem; color: var(--muted); }

.pv-portal-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 34px 5vw 70px;
}

.pv-stats {
  display: flex;
  gap: 18px;
  margin-bottom: 22px;
  font-size: 0.84rem;
  color: var(--muted);
}

.pv-stat strong { color: var(--beige); font-family: var(--font-display); }

/* Dropzone */
.pv-dropzone {
  border: 2px dashed rgba(201, 168, 124, 0.38);
  border-radius: 13px;
  padding: 34px 22px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-mid);
  transition: border-color 0.22s, background 0.22s;
}

.pv-dropzone:hover,
.pv-dropzone.pv-dragover {
  border-color: var(--sand);
  background: rgba(201, 168, 124, 0.06);
}

.pv-drop-icon {
  width: 34px;
  height: 34px;
  color: var(--sand);
  margin-bottom: 10px;
}

.pv-dropzone-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 5px;
}

.pv-dropzone-note {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.55;
}

/* Queue */
.pv-queue { margin-top: 14px; }

.pv-queue-item {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 9px;
}

.pv-queue-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.83rem;
}

.pv-queue-name {
  color: var(--text);
  word-break: break-all;
  font-weight: 500;
}

.pv-queue-status { color: var(--muted); white-space: nowrap; font-size: 0.78rem; }
.pv-queue-status.is-done { color: var(--success); }
.pv-queue-status.is-fail { color: var(--danger); }

.pv-progress {
  height: 5px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 4px;
  overflow: hidden;
}

.pv-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background-image: var(--gradient);
  background-size: 300% 300%;
  transition: width 0.25s ease;
  animation: warmFlow 4s ease infinite;
}

/* Section title */
.pv-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 34px 0 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}

.pv-count {
  background: var(--brown);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
}

/* Files */
.pv-file-list { display: flex; flex-direction: column; gap: 11px; }

.pv-file-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 16px;
  transition: border-color 0.22s;
}

.pv-file-row:hover { border-color: rgba(201, 168, 124, 0.4); }

.pv-file-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  color: var(--muted);
}

.pv-file-icon.is-video { color: var(--sand); }

.pv-file-icon svg { width: 100%; height: 100%; display: block; }

.pv-file-body { flex: 1 1 auto; min-width: 0; }

.pv-file-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  word-break: break-word;
  line-height: 1.45;
  margin-bottom: 3px;
}

.pv-file-meta { font-size: 0.77rem; color: var(--muted); }

.pv-file-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 7px;
  align-items: center;
}

.pv-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--beige);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.pv-icon-btn:hover {
  background: rgba(201, 168, 124, 0.18);
  border-color: var(--sand);
}

.pv-icon-btn svg { width: 19px; height: 19px; display: block; }

/* Inline player */
.pv-player-wrap {
  margin-top: 13px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.pv-player-wrap video {
  display: block;
  width: 100%;
  max-height: 58vh;
  background: #000;
}

.pv-empty-note {
  font-size: 0.87rem;
  color: var(--muted);
  text-align: center;
  padding: 26px 0;
}

.pv-portal-footer {
  border-top: 1px solid var(--border);
  padding: 22px 5vw;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.pv-portal-footer a { color: var(--sand); }
.pv-portal-footer a:hover { color: var(--beige); }

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

@media (max-width: 700px) {
  .pv-card { padding: 28px 22px; }

  .pv-portal-header { padding: 16px 18px; }
  .pv-portal-title { font-size: 1.02rem; }
  .pv-portal-body { padding: 24px 18px 60px; }

  .pv-file-row { flex-wrap: wrap; }

  .pv-file-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 4px;
  }

  .pv-dropzone { padding: 26px 16px; }
}

@media (max-width: 400px) {
  .pv-portal-name { display: none; }
}
