/* ==========================================================================
   DQcoding Portal — Login · Register · Dashboard
   ========================================================================== */

/* --------------------------------------------------------------------------
   PORTAL LANDING (Login / Register)
   -------------------------------------------------------------------------- */
.portal-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100dvh - var(--nav-h));
}
@media (max-width: 860px) {
  .portal-wrap { grid-template-columns: 1fr; }
}

.portal-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 4vw, 5rem);
  background: linear-gradient(160deg, var(--c-surface) 0%, var(--c-bg) 100%);
  border-right: 1px solid var(--c-line);
  position: relative;
  overflow: hidden;
}
.portal-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(22,224,245,.08) 0%, transparent 70%);
  pointer-events: none;
}
.portal-hero h1 {
  font-family: var(--f-display);
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.portal-hero h1 .accent { color: var(--c-ice); }
.portal-hero p { color: var(--c-text-soft); font-size: var(--t-lead); max-width: 42ch; margin-bottom: 2rem; }

.portal-features { list-style: none; display: flex; flex-direction: column; gap: .8rem; }
.portal-features li {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .95rem;
  color: var(--c-text-soft);
}
.portal-features li svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--c-ice);
}

.portal-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 4vw, 4rem);
}

.portal-card {
  width: 100%;
  max-width: 420px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 2.2rem 2rem;
}

.portal-tabs {
  display: flex;
  border-bottom: 1px solid var(--c-line);
  margin-bottom: 1.8rem;
}
.portal-tab {
  flex: 1;
  background: none;
  border: none;
  padding: .7rem 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--c-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--d-fast) var(--e-out), border-color var(--d-fast) var(--e-out);
  font-family: var(--f-body);
}
.portal-tab:hover { color: var(--c-text-soft); }
.portal-tab.active {
  color: var(--c-ice);
  border-bottom-color: var(--c-ice);
}

.portal-panel { display: none; }
.portal-panel.active { display: block; }

.portal-field { margin-bottom: 1rem; }
.portal-field label {
  display: block;
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--c-text-soft);
  margin-bottom: .3rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.portal-field input,
.portal-field select,
.portal-field textarea {
  width: 100%;
  padding: .875rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-line-strong);
  background: var(--c-bg-2);
  color: var(--c-text);
  font-size: var(--t-body);
  font-family: var(--f-body);
  outline: none;
  transition: border-color var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out);
  box-sizing: border-box;
}
.portal-field input:focus,
.portal-field select:focus,
.portal-field textarea:focus {
  border-color: var(--c-ice);
  box-shadow: 0 0 0 3px rgba(22,224,245,0.15);
}
.portal-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.4rem;
}
.portal-field select option { background: var(--c-bg-2); color: var(--c-text); }
.portal-field textarea { resize: vertical; min-height: 80px; }

.portal-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 540px) { .portal-row2 { grid-template-columns: 1fr; } }

.portal-check {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: 1.2rem;
  font-size: var(--t-small);
  color: var(--c-text-soft);
}
.portal-check input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--c-ice);
  flex-shrink: 0;
}

/* Submit button — uses main site .btn system (pill, Archivo, gradient) */
.portal-btn-submit {
  width: 100%;
  padding: 1.05rem 1.9rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--c-ice) 0%, var(--c-ice-deep) 100%);
  color: #06070A;
  font-size: .93rem;
  font-weight: 650;
  font-family: var(--f-display);
  cursor: pointer;
  transition: transform var(--d-fast) var(--e-spring), box-shadow var(--d-fast) var(--e-out), opacity var(--d-fast) var(--e-out);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.portal-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -6px rgba(22,224,245,0.45);
}
.portal-btn-submit:active { transform: translateY(0) scale(.98); }
.portal-btn-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.portal-divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 1.2rem 0;
  font-size: var(--t-micro);
  color: var(--c-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.portal-divider::before,
.portal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-line);
}

/* WhatsApp CTA button — main site .btn--ghost style */
.portal-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: 1.05rem 1.9rem;
  border-radius: 999px;
  background: rgba(37,211,102,.08);
  border: 1px solid rgba(37,211,102,.3);
  color: var(--c-signal);
  font-size: .93rem;
  font-weight: 650;
  font-family: var(--f-display);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--d-fast) var(--e-spring), box-shadow var(--d-fast) var(--e-out), background var(--d-fast) var(--e-out);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.portal-wa-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -6px rgba(37,211,102,0.35);
  background: rgba(37,211,102,.15);
}
.portal-wa-btn:active { transform: translateY(0) scale(.98); }
.portal-wa-btn svg { width: 20px; height: 20px; }

.portal-footer-note {
  text-align: center;
  margin-top: 1rem;
  font-size: var(--t-small);
  color: var(--c-faint);
}
.portal-footer-note a { color: var(--c-ice); text-decoration: none; }

/* --------------------------------------------------------------------------
   DASHBOARD
   -------------------------------------------------------------------------- */
.dash {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100dvh - var(--nav-h));
}
@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; }
}

.dash-sidebar {
  background: var(--c-surface);
  border-right: 1px solid var(--c-line);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
}
@media (max-width: 860px) {
  .dash-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    flex-direction: row;
    padding: 0;
    border-right: none;
    border-top: 1px solid var(--c-line);
    background: var(--c-bg);
  }
}

.dash-user {
  padding: 0 1.2rem 1.2rem;
  border-bottom: 1px solid var(--c-line);
  margin-bottom: .8rem;
}
@media (max-width: 860px) { .dash-user { display: none; } }

.dash-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-ice), var(--c-ice-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #06070A;
  margin-bottom: .6rem;
}
.dash-user-name { font-weight: 600; font-size: .95rem; }
.dash-user-email { font-size: var(--t-small); color: var(--c-muted); word-break: break-all; }

.dash-nav { list-style: none; display: flex; flex-direction: column; gap: 2px; flex: 1; }
@media (max-width: 860px) {
  .dash-nav {
    flex-direction: row;
    justify-content: space-around;
    padding: .5rem 0;
  }
}

.dash-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding: .6rem 1.2rem;
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--c-muted);
  text-decoration: none;
  border-radius: var(--radius);
  margin: 0 .6rem;
  transition: background var(--d-fast) var(--e-out), color var(--d-fast) var(--e-out);
  cursor: pointer;
}
.dash-nav-item svg { width: 20px; height: 20px; }
.dash-nav-item:hover { background: rgba(255,255,255,.04); color: var(--c-text-soft); }
.dash-nav-item.active { background: rgba(22,224,245,.1); color: var(--c-ice); }

.dash-logout {
  margin-top: auto;
  padding: .6rem 1.2rem;
  border: none;
  background: none;
  color: var(--c-muted);
  font-size: var(--t-small);
  font-family: var(--f-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-radius: var(--radius);
  margin: auto .6rem 0;
  transition: color var(--d-fast) var(--e-out);
}
.dash-logout:hover { color: #ef4444; }
@media (max-width: 860px) { .dash-logout span { display: none; } }

.dash-main {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  overflow-y: auto;
}
@media (max-width: 860px) {
  .dash-main { padding-bottom: calc(80px + clamp(1.5rem, 3vw, 2.5rem)); }
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.dash-header h2 {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
  font-weight: 700;
}

/* Stat cards — unified with admin */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.dash-stat {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  transition: border-color var(--d-fast) var(--e-out), transform var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out);
}
.dash-stat:hover {
  border-color: var(--c-line-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.4);
}
.dash-stat__label {
  font-size: var(--t-small);
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dash-stat__value {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.2rem);
  font-weight: 700;
  line-height: 1.1;
}
.dash-stat__value--accent {
  background: linear-gradient(135deg, var(--c-ice) 0%, var(--c-heat) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Upload area */
.dash-upload {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}
.dash-upload h3 {
  font-family: var(--f-display);
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.upload-drop {
  border: 2px dashed var(--c-line-strong);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--d-fast) var(--e-out), background var(--d-fast) var(--e-out);
  position: relative;
}
.upload-drop:hover,
.upload-drop.dragover {
  border-color: var(--c-ice);
  background: rgba(22,224,245,.04);
}
.upload-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-drop__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto .8rem;
  color: var(--c-muted);
}
.upload-drop__text { color: var(--c-text-soft); font-size: var(--t-body); }
.upload-drop__text strong { color: var(--c-ice); }
.upload-drop__hint { color: var(--c-faint); font-size: var(--t-small); margin-top: .4rem; }
.upload-drop__filename {
  margin-top: .8rem;
  padding: .5rem .8rem;
  border-radius: var(--radius);
  background: rgba(22,224,245,.08);
  color: var(--c-ice);
  font-size: var(--t-small);
  font-weight: 600;
  display: none;
  word-break: break-all;
}
.upload-drop__filename.show { display: inline-block; }

/* Upload form fields */
.upload-form { margin-top: 1.2rem; }
.upload-form .portal-row2 { margin-bottom: 0; }

.upload-note {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin-top: 1rem;
  padding: .8rem 1rem;
  border-radius: var(--radius);
  background: rgba(22,224,245,.06);
  border: 1px solid rgba(22,224,245,.15);
  font-size: var(--t-small);
  color: var(--c-text-soft);
}
.upload-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--c-ice); }

/* Request list */
.dash-requests {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dash-requests h3 {
  font-family: var(--f-display);
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  font-weight: 700;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--c-line);
}

.req-list { list-style: none; }
.req-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--c-line);
  transition: background var(--d-fast) var(--e-out);
}
.req-item:last-child { border-bottom: none; }
.req-item:hover { background: rgba(255,255,255,.02); }

.req-info { min-width: 0; }
.req-car { font-weight: 600; font-size: var(--t-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-service { font-size: var(--t-small); color: var(--c-muted); margin-top: .15rem; font-weight: 500; }
.req-date { font-size: var(--t-micro); color: var(--c-faint); margin-top: .15rem; }

/* Status badges — unified system */
.req-status {
  padding: .3rem .8rem;
  border-radius: 999px;
  font-size: var(--t-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.req-status--pending { background: rgba(255,106,23,.12); color: var(--c-heat); }
.req-status--processing { background: rgba(22,224,245,.12); color: var(--c-ice); }
.req-status--decrypting { background: rgba(168,85,247,.15); color: #A855F7; }
.req-status--tuning { background: rgba(22,224,245,.2); color: var(--c-ice); }
.req-status--encrypting { background: rgba(168,85,247,.15); color: #A855F7; }
.req-status--ready { background: rgba(34,197,94,.15); color: #22C55E; }
.req-status--done { background: rgba(37,211,102,.12); color: var(--c-signal); }
.req-status--rejected { background: rgba(239,68,68,.15); color: #EF4444; }

.req-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--c-faint);
  font-size: var(--t-body);
}

/* Profile section */
.dash-profile {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 540px;
}
.dash-profile h3 {
  font-family: var(--f-display);
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  font-weight: 700;
  margin-bottom: 1.2rem;
}
.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-ice), var(--c-ice-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.6rem;
  color: #06070A;
  margin-bottom: 1.2rem;
}

/* Success overlay */
.portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4,5,7,.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--d-fast) var(--e-out);
}
.portal-overlay.active { opacity: 1; pointer-events: auto; }
.portal-overlay__box {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  max-width: 380px;
  text-align: center;
  animation: slideUp var(--d-mid) var(--e-spring);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.portal-overlay__box svg { width: 48px; height: 48px; color: var(--c-signal); margin: 0 auto 1rem; }
.portal-overlay__box h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.portal-overlay__box p { color: var(--c-text-soft); font-size: var(--t-body); margin-bottom: 1.2rem; }
.portal-overlay__box button {
  padding: .875rem 1.5rem;
  border: 1px solid var(--c-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: var(--t-body);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--d-fast) var(--e-out), background var(--d-fast) var(--e-out);
}
.portal-overlay__box button:hover {
  border-color: var(--c-text-soft);
  background: var(--c-bg-2);
}

/* --------------------------------------------------------------------------
   ERROR MESSAGES
   -------------------------------------------------------------------------- */
.portal-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  color: #EF4444;
  padding: .6rem 1rem;
  border-radius: var(--radius);
  font-size: var(--t-small);
  margin-bottom: 1rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   CREDITS DISPLAY
   -------------------------------------------------------------------------- */
.dash-stat__value--accent {
  background: linear-gradient(135deg, var(--c-ice) 0%, var(--c-heat) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(22,224,245,.1);
  border: 1px solid rgba(22,224,245,.2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--c-ice);
}
.credits-badge svg {
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------------------
   STATUS TIMELINE
   -------------------------------------------------------------------------- */
.req-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--c-line);
  overflow-x: auto;
}
.tl-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--t-micro);
  color: var(--c-muted);
  white-space: nowrap;
  position: relative;
  padding-right: 16px;
}
.tl-step:last-child { padding-right: 0; }
.tl-step::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--c-line-strong);
}
.tl-step:last-child::after { display: none; }
.tl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  flex-shrink: 0;
}
.tl-step--done .tl-dot { background: #22C55E; }
.tl-step--active .tl-dot {
  background: var(--c-ice);
  box-shadow: 0 0 8px rgba(22,224,245,.4);
}
.tl-step--active { color: var(--c-ice); font-weight: 600; }
.tl-step--done { color: #22C55E; }
.req-note {
  font-size: var(--t-small);
  color: var(--c-text-soft);
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--c-bg-2);
  border-radius: var(--radius);
}
.req-file {
  font-size: var(--t-small);
  color: var(--c-text-soft);
  margin-top: 4px;
}
.req-file a {
  color: var(--c-ice);
  text-decoration: none;
  transition: color var(--d-fast) var(--e-out);
}
.req-file a:hover {
  color: var(--c-ice-deep);
  text-decoration: underline;
}
.req-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: var(--t-small);
  color: var(--c-text-soft);
  margin-top: 4px;
}
