/* ========================================
   Change Portal — Client Portal Styles
   ======================================== */

/* --- Login --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  padding: var(--space-md);
}

.login-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.login-card .portal-logo {
  justify-content: center;
  margin-bottom: var(--space-xs);
}

.login-card .portal-logo img {
  height: 56px;
}

.login-card .portal-logo .logo-text {
  font-size: 1.75rem;
}

.login-tagline {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}

.login-form {
  text-align: left;
}

.login-footer {
  margin-top: var(--space-md);
  font-size: 0.8rem;
  color: var(--color-text-light);
}

/* --- Dashboard --- */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.request-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.request-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  cursor: default;
}

.request-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--color-primary-light);
  flex-shrink: 0;
}

.request-card-body {
  flex: 1;
  min-width: 0;
}

.request-card-body h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.request-card-body p {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

.request-card-footer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--color-text-light);
}

/* --- New Request Page --- */
.request-page {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: var(--space-xl);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-border);
}

.tab {
  padding: 0.75rem var(--space-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Recorder */
.recorder {
  text-align: center;
  padding: var(--space-lg) 0;
}

.recorder-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  transition: all 0.3s;
}

.recorder-ring.recording {
  border-color: var(--color-rejected);
  box-shadow: 0 0 0 8px rgba(231, 76, 60, 0.15);
  animation: pulse-ring 1.5s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0.15); }
  50% { box-shadow: 0 0 0 16px rgba(231, 76, 60, 0.05); }
}

.recorder-status {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: var(--space-xs);
}

.recorder-timer {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

/* Waveform animation */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 40px;
  margin-bottom: var(--space-sm);
  opacity: 0;
  transition: opacity 0.3s;
}

.waveform.active {
  opacity: 1;
}

.waveform span {
  width: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  animation: wave 0.8s ease-in-out infinite;
}

.waveform span:nth-child(1) { height: 12px; animation-delay: 0s; }
.waveform span:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.waveform span:nth-child(3) { height: 28px; animation-delay: 0.2s; }
.waveform span:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.waveform span:nth-child(5) { height: 12px; animation-delay: 0.4s; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.upload-zone-icon {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.upload-zone p {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin: 0 auto;
}

/* File/photo previews */
.file-preview {
  display: none;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-sm);
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.file-preview-info {
  flex: 1;
  min-width: 0;
}

.file-preview-name {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-size {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.file-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-light);
  font-size: 1.25rem;
  padding: 0.25rem;
}

.file-remove:hover {
  color: var(--color-rejected);
}

/* Photo upload */
.photo-section {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.photo-section h3 {
  margin-bottom: var(--space-sm);
  font-size: 1rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb .photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Processing steps */
.processing {
  text-align: center;
  padding: var(--space-xl) 0;
}

.processing-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  margin: 0 auto var(--space-md);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.processing-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.processing-sub {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}

.processing-steps {
  max-width: 300px;
  margin: 0 auto;
  text-align: left;
}

.p-step {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.5rem 0;
  color: var(--color-text-light);
  font-size: 0.9rem;
  transition: all 0.3s;
}

.p-step.active {
  color: var(--color-text);
  font-weight: 600;
}

.p-step.done {
  color: var(--color-approved);
}

.p-step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.p-step-icon.spinning {
  border-color: var(--color-primary);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-header .btn {
    text-align: center;
  }

  .tabs {
    overflow-x: auto;
  }

  .recorder-ring {
    width: 120px;
    height: 120px;
  }
}
