/* =====================================================
   UNITEL T+ DOCUMENT VERIFICATION - STYLES
   Brand Colors extracted from uniteltmais.cv
   ===================================================== */

/* CSS Variables - Brand Colors */
:root {
  --primary-orange: #ff6b00;
  --primary-orange-dark: #e55a00;
  --primary-orange-light: #ff8533;
  --secondary-purple: #9b59b6;
  --accent-red: #e74c3c;
  --text-dark: #333333;
  --text-gray: #666666;
  --text-light: #999999;
  --bg-light: #fff5f0;
  --bg-white: #ffffff;
  --bg-gray: #f5f5f5;
  --success-green: #27ae60;
  --error-red: #e74c3c;
  --border-color: #e0e0e0;
  --shadow: 0 4px 20px rgba(255, 107, 0, 0.15);
  --shadow-hover: 0 8px 30px rgba(255, 107, 0, 0.25);
  --transition: all 0.3s ease;
}

/* ─── Language Switcher ──────────────────────────────────────── */

/* Make header a flex column so the switcher occupies its own row */
.header,
.landing-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Switcher sits in the normal flow — pushed to the right,
   always rendered before logo/title via order:-1 */
.lang-switcher {
  position: relative; /* dropdown is absolute relative to this */
  align-self: flex-end;
  order: -1; /* visually first, regardless of DOM position */
  margin-bottom: 10px;
  z-index: 10;
}

/* Trigger button */
.lang-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-white);
  border: 1.5px solid var(--border-color);
  border-radius: 24px;
  padding: 6px 11px 6px 9px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  min-height: 38px; /* comfortable tap target */
  white-space: nowrap;
}

.lang-trigger:hover {
  border-color: var(--primary-orange);
  color: var(--primary-orange);
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.18);
}

.lang-trigger-flag {
  font-size: 18px;
  line-height: 1;
}

.lang-trigger-label {
  font-size: 13px;
}

.lang-caret {
  color: var(--text-gray);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.lang-switcher--open .lang-caret {
  transform: rotate(180deg);
}

/* Dropdown panel */
.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-white);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  min-width: 148px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Hidden by default */
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.lang-switcher--open .lang-dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Individual option */
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  text-align: left;
  transition:
    background 0.18s ease,
    color 0.18s ease;
  width: 100%;
}

.lang-option:hover {
  background: var(--bg-light);
  color: var(--primary-orange);
}

.lang-opt-flag {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.lang-opt-label {
  flex: 1;
}

.lang-opt-check {
  color: transparent;
  flex-shrink: 0;
  transition: color 0.18s ease;
}

.lang-option--active {
  background: var(--bg-light);
  color: var(--primary-orange);
  font-weight: 700;
}

.lang-option--active .lang-opt-check {
  color: var(--primary-orange);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
  min-height: 100vh;
  color: var(--text-dark);
  line-height: 1.6;
}

/* Container */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

/* Header */
.header {
  text-align: center;
  padding: 20px 0 30px;
  border-bottom: 3px solid var(--primary-orange);
  margin-bottom: 30px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.logo-image {
  height: 50px;
  width: auto;
  max-width: 100%;
}

/* Legacy logo styles */
.logo-icon {
  width: 50px;
  height: 50px;
  background: var(--primary-orange);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 24px;
}

.logo-text {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-orange);
}

.logo-text span {
  color: var(--secondary-purple);
}

.header h1 {
  color: var(--text-dark);
  font-size: 24px;
  margin-top: 15px;
}

.header p {
  color: var(--text-gray);
  font-size: 14px;
  margin-top: 5px;
}

/* Progress Steps */
.progress-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 40px;
  padding: 0 20px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.step-circle {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--bg-gray);
  border: 3px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--text-light);
  transition: var(--transition);
  font-size: 16px;
}

.step-circle.active {
  background: var(--primary-orange);
  border-color: var(--primary-orange);
  color: white;
  box-shadow: 0 0 15px rgba(255, 107, 0, 0.4);
}

.step-circle.completed {
  background: var(--success-green);
  border-color: var(--success-green);
  color: white;
}

.step-label {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  max-width: 80px;
}

.step-label.active {
  color: var(--primary-orange);
  font-weight: 600;
}

.progress-line {
  width: 80px;
  height: 4px;
  background: var(--border-color);
  margin: 0 10px;
  margin-bottom: 25px;
  border-radius: 2px;
  transition: var(--transition);
}

.progress-line.completed {
  background: var(--success-green);
}

/* Cards */
.card {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title .icon {
  width: 35px;
  height: 35px;
  background: linear-gradient(
    135deg,
    var(--primary-orange),
    var(--primary-orange-light)
  );
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

/* Upload Areas */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.upload-grid.single {
  grid-template-columns: 1fr;
  max-width: 300px;
  margin: 0 auto;
}

.upload-box {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-gray);
  position: relative;
  overflow: hidden;
}

.upload-box:hover {
  border-color: var(--primary-orange);
  background: var(--bg-light);
}

.upload-box.has-file {
  border-color: var(--success-green);
  border-style: solid;
  background: #f0fff4;
}

.upload-box.error {
  border-color: var(--error-red);
  background: #fff5f5;
}

.upload-icon {
  font-size: 40px;
  margin-bottom: 10px;
  color: var(--text-light);
}

.upload-box.has-file .upload-icon {
  color: var(--success-green);
}

.upload-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-light);
}

.upload-input {
  display: none;
}

/* Image Preview */
.preview-container {
  position: relative;
  width: 100%;
  margin-top: 15px;
}

.preview-image {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--success-green);
}

.remove-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  background: var(--error-red);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.remove-btn:hover {
  background: #c0392b;
  transform: scale(1.1);
}

/* Video Recording Section */
.video-section {
  display: none;
}

.video-section.active {
  display: block;
}

.video-container {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  margin-bottom: 20px;
  max-height: 500px;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  transition: var(--transition);
}

.video-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.video-overlay .icon {
  font-size: 60px;
  margin-bottom: 15px;
  opacity: 0.8;
}

.video-overlay p {
  font-size: 16px;
  opacity: 0.9;
}

/* Timer */
.timer-display {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: bold;
  display: none;
}

.timer-display.active {
  display: block;
}

.timer-display.warning {
  background: var(--error-red);
  animation: pulse 0.5s ease infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Recording Indicator */
.recording-indicator {
  position: absolute;
  top: 15px;
  left: 70px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--error-red);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  display: none;
}

.recording-indicator.active {
  display: flex;
}

.recording-dot {
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  animation: blink 1s ease infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Camera Switch Button (Mobile Only) */
.camera-switch-btn {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 45px;
  height: 45px;
  background: rgba(255, 107, 0, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: bold;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.4);
  transition: var(--transition);
  z-index: 10;
  color: white;
}

.camera-switch-btn:hover {
  background: var(--primary-orange-dark);
  transform: scale(1.05);
}

.camera-switch-btn:active {
  transform: scale(0.9);
}

.camera-switch-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.camera-switch-btn span {
  line-height: 1;
  display: block;
}

/* Hide camera switch on desktop */
@media (min-width: 769px) {
  .camera-switch-btn {
    display: none !important;
  }
}

/* Video Controls */
.video-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  padding: 14px 32px;
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 140px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-orange),
    var(--primary-orange-dark)
  );
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
}

.btn-secondary {
  background: var(--bg-gray);
  color: var(--text-dark);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary-orange);
  color: var(--primary-orange);
}

.btn-danger {
  background: var(--error-red);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #c0392b;
}

.btn-success {
  background: var(--success-green);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #219a52;
}

.btn-record {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  padding: 0;
  min-width: auto;
  font-size: 24px;
}

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

/* Error Messages */
.error-message {
  background: #fff5f5;
  border: 1px solid var(--error-red);
  border-radius: 10px;
  padding: 15px;
  margin-top: 15px;
  display: none;
}

.error-message.show {
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-message .icon {
  color: var(--error-red);
  font-size: 20px;
}

.error-message p {
  color: var(--error-red);
  font-size: 14px;
}

/* Success Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  transform: scale(0.8);
  transition: var(--transition);
}

.modal-overlay.show .modal {
  transform: scale(1);
}

.success-icon {
  width: 100px;
  height: 100px;
  background: var(--success-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
  animation: successPop 0.5s ease;
}

@keyframes successPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.success-icon .checkmark {
  font-size: 50px;
  color: white;
}

.modal h2 {
  color: var(--text-dark);
  font-size: 24px;
  margin-bottom: 10px;
}

.modal p {
  color: var(--text-gray);
  font-size: 14px;
  margin-bottom: 25px;
}

.redirect-text {
  color: var(--text-light);
  font-size: 13px;
}

/* Landing Page Styles */
.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
}

.landing-header {
  text-align: center;
  margin-bottom: 50px;
}

.landing-header h1 {
  font-size: 32px;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.landing-header p {
  color: var(--text-gray);
  font-size: 16px;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  max-width: 600px;
  width: 100%;
}

@media (max-width: 500px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
}

.option-card {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: 3px solid transparent;
  text-decoration: none;
  color: inherit;
}

.option-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-orange);
}

.option-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(
    135deg,
    var(--primary-orange),
    var(--primary-orange-light)
  );
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 40px;
  color: white;
}

.option-card h3 {
  font-size: 20px;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.option-card p {
  color: var(--text-gray);
  font-size: 14px;
  line-height: 1.5;
}

/* Camera Permission Error */
.camera-error {
  background: #fff5f5;
  border: 2px solid var(--error-red);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  margin: 20px 0;
}

.camera-error .icon {
  font-size: 50px;
  color: var(--error-red);
  margin-bottom: 15px;
}

.camera-error h3 {
  color: var(--error-red);
  margin-bottom: 10px;
}

.camera-error p {
  color: var(--text-gray);
  font-size: 14px;
  margin-bottom: 20px;
}

.camera-error ul {
  text-align: left;
  color: var(--text-gray);
  font-size: 13px;
  margin: 15px 0;
  padding-left: 20px;
}

.camera-error li {
  margin-bottom: 8px;
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--bg-gray);
  border-top-color: var(--primary-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

/* Info Box */
.info-box {
  background: var(--bg-light);
  border-left: 4px solid var(--primary-orange);
  padding: 15px;
  border-radius: 0 8px 8px 0;
  margin-top: 20px;
}

.info-box p {
  color: var(--text-gray);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.info-box .icon {
  color: var(--primary-orange);
  font-size: 18px;
  flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 480px) {
  .container {
    padding: 15px;
  }

  .header {
    padding: 10px 0;
  }

  .logo-text {
    font-size: 24px;
  }

  .header h1 {
    font-size: 20px;
  }

  .card {
    padding: 20px;
  }

  .upload-grid {
    grid-template-columns: 1fr;
  }

  .upload-box {
    padding: 25px 15px;
  }

  .progress-line {
    width: 50px;
  }

  .step-circle {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 14px;
  }

  .btn-full {
    margin-top: 20px;
  }

  .video-controls {
    gap: 10px;
  }

  .video-container {
    aspect-ratio: 16/9;
    max-height: 50vh;
    border-radius: 8px;
    margin-bottom: 15px;
  }

  .video-container video {
    object-fit: contain;
  }

  .timer-display {
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    font-size: 16px;
    border-radius: 15px;
  }

  .recording-indicator {
    top: 10px;
    left: 60px;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 15px;
  }

  .camera-switch-btn {
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .btn-record {
    width: 65px;
    height: 65px;
    font-size: 22px;
  }

  .landing-header h1 {
    font-size: 26px;
  }

  .logo-image {
    height: 40px;
  }

  .option-card {
    padding: 30px 20px;
  }

  .option-icon {
    width: 60px;
    height: 60px;
    font-size: 30px;
  }
}

/* Hide sections by default */
.step-section {
  display: none;
}

.step-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* WhatsApp Button Style */
.btn-whatsapp {
  background: #25d366;
  color: white;
}

.btn-whatsapp:hover:not(:disabled) {
  background: #128c7e;
}

/* =====================================================
   FULL-PAGE LOADING OVERLAY
   Used while checking session status on page load
   ===================================================== */
.page-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.3s ease;
}

.page-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.page-loading-overlay .loading-icon {
  font-size: 50px;
  margin-bottom: 20px;
}

.page-loading-overlay h3 {
  color: var(--text-dark);
  margin-bottom: 8px;
  font-size: 18px;
}

.page-loading-overlay p {
  color: var(--text-gray);
  font-size: 14px;
  margin-bottom: 10px;
}

/* =====================================================
   ERROR OVERLAY
   Shown when contact number is missing or session fails
   ===================================================== */
.page-error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 30px;
  text-align: center;
}

.page-error-overlay.hidden {
  display: none;
}

.page-error-overlay .error-icon {
  font-size: 60px;
  margin-bottom: 20px;
}

.page-error-overlay h3 {
  color: var(--error-red);
  margin-bottom: 10px;
  font-size: 20px;
}

.page-error-overlay p {
  color: var(--text-gray);
  font-size: 14px;
  margin-bottom: 20px;
  max-width: 400px;
}

/* =====================================================
   BUTTON LOADING STATE
   Spinner inside buttons during API calls
   ===================================================== */
.btn .btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn.loading .btn-spinner {
  display: inline-block;
}

.btn.loading .btn-text {
  display: none;
}

/* =====================================================
   UPLOAD PROGRESS OVERLAY
   Full-screen overlay shown during image/video upload
   ===================================================== */
.upload-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  backdrop-filter: blur(4px);
}

.upload-overlay.active {
  opacity: 1;
  visibility: visible;
}

.upload-overlay-content {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 40px 30px;
  text-align: center;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: overlaySlideUp 0.3s ease;
}

@keyframes overlaySlideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.upload-overlay-spinner {
  width: 56px;
  height: 56px;
  border: 5px solid var(--bg-gray);
  border-top-color: var(--primary-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}

.upload-overlay-content h3 {
  color: var(--text-dark);
  font-size: 18px;
  margin-bottom: 8px;
}

.upload-overlay-content p {
  color: var(--text-gray);
  font-size: 14px;
  margin-bottom: 20px;
}

.upload-overlay-warning {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #f57f17;
}

.upload-overlay-warning .icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* =====================================================
   PHOTO PICKER BOTTOM-SHEET
   Choose between camera and gallery
   ===================================================== */
.photo-picker-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 4000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.photo-picker-overlay.active {
  opacity: 1;
  visibility: visible;
}

.photo-picker-sheet {
  background: var(--bg-white);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px;
  width: 100%;
  max-width: 480px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-picker-overlay.active .photo-picker-sheet {
  transform: translateY(0);
}

.photo-picker-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 6px;
}

.photo-picker-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-white);
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  transition: var(--transition);
  width: 100%;
  text-align: left;
}

.photo-picker-option:hover {
  border-color: var(--primary-orange);
  background: var(--bg-light);
  color: var(--primary-orange);
}

.photo-picker-option:active {
  transform: scale(0.98);
}

.photo-picker-option-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.photo-picker-cancel {
  margin-top: 4px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: var(--bg-gray);
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-gray);
  transition: var(--transition);
  width: 100%;
}

.photo-picker-cancel:hover {
  background: var(--border-color);
  color: var(--text-dark);
}

/* Desktop: center the sheet as a card instead of bottom-sheet */
@media (min-width: 769px) {
  .photo-picker-overlay {
    align-items: center;
  }

  .photo-picker-sheet {
    border-radius: 20px;
    max-width: 400px;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition:
      transform 0.3s ease,
      opacity 0.3s ease;
  }

  .photo-picker-overlay.active .photo-picker-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* =====================================================
   CAMERA CAPTURE OVERLAY
   Live camera for taking photos
   ===================================================== */
.camera-capture-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.camera-capture-overlay.active {
  opacity: 1;
  visibility: visible;
}

.camera-capture-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.camera-capture-container video {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
}

.camera-capture-controls {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 24px 40px;
  background: rgba(0, 0, 0, 0.85);
  flex-shrink: 0;
}

.camera-capture-btn {
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  background: transparent;
}

.camera-capture-cancel {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 22px;
}

.camera-capture-cancel:hover {
  background: rgba(255, 255, 255, 0.35);
}

.camera-capture-shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  padding: 0;
  position: relative;
}

.camera-capture-shutter:hover {
  transform: scale(1.05);
}

.camera-capture-shutter:active {
  transform: scale(0.92);
}

.shutter-ring {
  display: block;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #333;
  background: white;
  margin: auto;
}

.camera-capture-switch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 22px;
}

.camera-capture-switch:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Camera capture error */
.camera-capture-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: white;
}

.capture-error-icon {
  font-size: 60px;
  margin-bottom: 20px;
}

.camera-capture-error p {
  font-size: 16px;
  margin-bottom: 24px;
  max-width: 360px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.camera-capture-error .btn {
  min-width: 160px;
}

/* Camera capture preview */
.camera-capture-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000;
  min-height: 0;
  overflow: hidden;
}

.camera-capture-preview img {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: contain;
}

.camera-capture-preview-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 20px;
  background: rgba(0, 0, 0, 0.85);
  flex-shrink: 0;
}
