/* Test-flow pop-ups: copied unchanged from css/style.css (the main site) so v2 behaves identically. */

.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 0.8rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1.2rem 1.5rem;
  font-size: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #888;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #31af89;
  box-shadow: 0 0 0 3px rgba(49, 175, 137, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 10rem;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  animation: modalFadeIn 0.3s ease forwards;
  backdrop-filter: blur(5px);
}

@keyframes modalFadeIn {
  to {
    opacity: 1;
  }
}

.modal-overlay.hidden {
  display: none;
}

.test-modal {
  background: #fff;
  border-radius: 2rem;
  padding: 3.5rem;
  max-width: 50rem;
  width: 90%;
  box-shadow: 0 2.5rem 6rem rgba(0, 0, 0, 0.25);
  animation: modalSlideUp 0.4s ease;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(3rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-title {
  font-size: 2.6rem;
  font-weight: 700;
  color: #1a8b6d;
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-subtitle {
  font-size: 1.5rem;
  color: #666;
  margin-bottom: 2rem;
  text-align: center;
}

.instructions-list {
  list-style: none;
  padding: 0;
  margin-bottom: 2.5rem;
}

.instructions-list li {
  font-size: 1.4rem;
  color: #444;
  line-height: 1.9;
  margin-bottom: 1.2rem;
  padding-left: 2.5rem;
  position: relative;
}

.instructions-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #1a8b6d;
  font-weight: bold;
}

.proceed-btn {
  display: block;
  margin: 0 auto;
  background: linear-gradient(135deg, #1a8b6d 0%, #2ecc71 100%);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  padding: 1.2rem 4rem;
  border: none;
  border-radius: 5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(26, 139, 109, 0.3);
}

.proceed-btn:hover {
  transform: translateY(-0.3rem);
  box-shadow: 0 8px 25px rgba(26, 139, 109, 0.4);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: #fff;
  border: 2px solid #e53935;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  font-size: 1.6rem;
  color: #e53935;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #e53935;
  color: #fff;
  transform: scale(1.1);
}

.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 2rem 0 3rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.step-dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #ddd;
  transition: all 0.3s ease;
}

.step.active .step-dot {
  background: #2196f3;
  box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.2);
}

.step.completed .step-dot {
  background: #4caf50;
}

.step span {
  font-size: 1.2rem;
  color: #888;
  white-space: nowrap;
}

.step.active span {
  color: #2196f3;
  font-weight: 600;
}

.step.completed span {
  color: #4caf50;
  font-weight: 600;
}

.step-line {
  width: 6rem;
  height: 2px;
  background: #ddd;
  margin: 0 0.5rem;
  margin-bottom: 2rem;
}

.step-line.completed {
  background: #4caf50;
}

.personal-data-modal {
  background: #fff;
  border-radius: 2rem;
  padding: 3rem;
  max-width: 70rem;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.2);
  animation: modalSlideUp 0.4s ease;
  position: relative;
}

.personal-data-form {
  margin-top: 1rem;
}

.personal-data-form .form-group {
  margin-bottom: 2rem;
}

.personal-data-form .form-group label {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.8rem;
}

.personal-data-form .form-group input[type="text"],
.personal-data-form .form-group input[type="number"],
.personal-data-form .form-group input[type="date"] {
  width: 100%;
  padding: 1.2rem 1.5rem;
  font-size: 1.4rem;
  border: 2px solid #e0e0e0;
  border-radius: 1rem;
  background: #fafafa;
  transition: all 0.3s ease;
}

.personal-data-form .form-group input:focus {
  outline: none;
  border-color: #1a8b6d;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(26, 139, 109, 0.1);
}

.personal-data-form .form-group input::placeholder {
  color: #aaa;
}

.personal-data-form .form-group input[readonly] {
  background: #e8f5e9;
  border-color: #a5d6a7;
  color: #2e7d32;
  cursor: not-allowed;
}

.gender-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.gender-btn {
  padding: 1rem 2rem;
  font-size: 1.4rem;
  border: 2px solid #e0e0e0;
  border-radius: 1rem;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.gender-btn:hover {
  border-color: #1a8b6d;
  background: #f0faf7;
}

.gender-btn.active {
  background: linear-gradient(135deg, #1a8b6d 0%, #2ecc71 100%);
  color: #fff;
  border-color: #1a8b6d;
}

.personal-data-form .form-group textarea {
  width: 100%;
  padding: 1.2rem 1.5rem;
  font-size: 1.4rem;
  border: 2px solid #e0e0e0;
  border-radius: 1rem;
  background: #fafafa;
  resize: vertical;
  font-family: inherit;
  transition: all 0.3s ease;
}

.personal-data-form .form-group textarea:focus {
  outline: none;
  border-color: #1a8b6d;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(26, 139, 109, 0.1);
}

.personal-data-form .form-group textarea::placeholder {
  color: #aaa;
}

.recording-modal {
  background: #fff;
  border-radius: 2rem;
  padding: 3rem;
  max-width: 70rem;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.2);
  animation: modalSlideUp 0.4s ease;
  position: relative;
}

.reading-section {
  margin-bottom: 2rem;
}

.reading-section h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
}

.reading-text {
  font-size: 1.5rem;
  color: #555;
  line-height: 1.9;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 2rem;
  border-radius: 1.5rem;
  max-height: 15rem;
  overflow-y: auto;
  border-left: 4px solid #1a8b6d;
}

.recording-section {
  margin-top: 2rem;
}

.media-controls {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.media-box {
  flex: 1;
  border-radius: 1.6rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e8e8e8;
  transition: all 0.3s ease;
}

.media-box:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}

.media-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.8rem;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.media-header span {
  font-size: 1.4rem;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.webcam-box {
  border-color: #e3f2fd;
}

.webcam-box .media-header {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.webcam-box .media-header i {
  color: #1976d2;
}

.webcam-box .media-content {
  background: #0d1117;
}

.audio-box {
  border-color: #fce4ec;
}

.audio-box .media-header {
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
}

.audio-box .media-header i {
  color: #c2185b;
}

.audio-box .media-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.record-single-btn {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: none;
  background: #ff5252;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(255, 82, 82, 0.3);
}

.record-single-btn i {
  color: #fff !important;
}

.record-single-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(255, 82, 82, 0.4);
}

.record-single-btn.recording {
  background: #d32f2f;
  animation: recordPulse 1s infinite;
}

@keyframes recordPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.6);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(211, 47, 47, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
  }
}

.combined-record-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem 0;
}

.combined-record-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 3rem;
  font-size: 1.8rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #e53935 0%, #d32f2f 100%);
  border: none;
  border-radius: 5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.combined-record-btn i {
  font-size: 1.4rem;
}

.combined-record-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(211, 47, 47, 0.4);
}

.combined-record-btn.recording {
  background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
  box-shadow: 0 4px 15px rgba(56, 142, 60, 0.3);
  animation: combinedRecordPulse 1.5s infinite;
}

.combined-record-btn.recording:hover {
  box-shadow: 0 8px 25px rgba(56, 142, 60, 0.4);
}

.combined-record-hint {
  margin-top: 1rem;
  font-size: 1.3rem;
  color: #757575;
}

@keyframes combinedRecordPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 142, 60, 0.5);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(56, 142, 60, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(56, 142, 60, 0);
  }
}

.media-content {
  flex: 1;
  position: relative;
  min-height: 18rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-actions {
  padding: 1.2rem;
  background: #fafafa;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.media-actions.hidden {
  display: none;
}

.play-btn {
  padding: 0.8rem 2rem;
  border-radius: 5rem;
  border: 2px solid #1976d2;
  background: #e3f2fd;
  color: #1976d2;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.play-btn:hover {
  background: #1976d2;
  color: #fff;
}

.webcam-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  transform: scaleX(-1);
}

.webcam-box video.active {
  display: block;
}

.webcam-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
}

.webcam-placeholder i {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.webcam-placeholder p {
  font-size: 1.2rem;
}

.webcam-placeholder.hidden {
  display: none;
}

.audio-visualizer {
  font-size: 5rem;
  color: rgba(255, 82, 82, 0.5);
  transition: all 0.3s ease;
}

.audio-visualizer.recording {
  color: #ff5252;
  animation: audioPulse 0.5s infinite alternate;
}

@keyframes audioPulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.15);
  }
}

.audio-status {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.6rem 1.5rem;
  border-radius: 5rem;
}

.device-selection {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.device-group {
  flex: 1;
}

.device-group label {
  display: block;
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.device-group select {
  width: 100%;
  padding: 1rem;
  font-size: 1.3rem;
  border: 2px solid #e0e0e0;
  border-radius: 1rem;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.3s ease;
}

.device-group select:focus {
  outline: none;
  border-color: #1a8b6d;
}

.recording-note {
  font-size: 1.2rem;
  color: #888;
  text-align: center;
  margin-bottom: 2rem;
}

.confirmation-modal {
  background: #fff;
  border-radius: 2rem;
  padding: 3rem;
  max-width: 60rem;
  width: 95%;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.2);
  animation: modalSlideUp 0.4s ease;
  position: relative;
}

.success-cards {
  display: flex;
  gap: 2rem;
  margin: 3rem 0;
  justify-content: center;
}

.success-card {
  width: 14rem;
  height: 14rem;
  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.video-success {
  border: 3px solid #4caf50;
}

.audio-success {
  border: 3px solid #4caf50;
}

.success-icon {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.success-icon i {
  font-size: 3rem;
  color: #fff;
}

.retry-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #4caf50;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.retry-btn:hover {
  color: #2e7d32;
}

.modal-nav {
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  margin-top: 2rem;
}

.back-btn {
  background: #fff;
  color: #666;
  font-size: 1.4rem;
  font-weight: 500;
  padding: 1rem 3rem;
  border: 2px solid #ddd;
  border-radius: 5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: #f5f5f5;
  border-color: #bbb;
}

.modal-nav .proceed-btn {
  margin: 0;
}

.analyzing-modal {
  background: #fff;
  border-radius: 2rem;
  padding: 3rem;
  max-width: 60rem;
  width: 95%;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.2);
  animation: modalSlideUp 0.4s ease;
  position: relative;
}

.analyzing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 3rem 0;
}

.analyzing-box {
  width: 25rem;
  height: 25rem;
  border: none;
  border-radius: 1rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.center-icon {
  width: 12rem;
  height: 12rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.center-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rotating-ring {
  position: absolute;
  width: 18rem;
  height: 18rem;
  border: 3px dashed #4ecdc4;
  border-radius: 50%;
  animation: ringRotate 8s linear infinite;
}

@keyframes ringRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.orbit-icon {
  position: absolute;
  width: 100%;
  height: 100%;
  transform: rotate(var(--angle));
}

.orbit-icon-inner {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: counterRotate 8s linear infinite;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes counterRotate {
  from {
    transform: translateX(-50%) rotate(0deg);
  }
  to {
    transform: translateX(-50%) rotate(-360deg);
  }
}

.orbit-icon-inner i {
  font-size: 1.8rem;
  color: #fff;
}

.brain-icon {
  background: linear-gradient(135deg, #f5a623 0%, #f7931a 100%);
}

.medical-icon {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.language-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.analysis-icon {
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}

.analyzing-text {
  font-size: 1.6rem;
  color: #666;
  margin-top: 2rem;
  text-align: center;
  font-weight: 500;
}

.auth-gate-modal {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border-radius: 2rem;
  padding: 3.5rem;
  max-width: 55rem;
  width: 95%;
  box-shadow: 0 2.5rem 6rem rgba(0, 0, 0, 0.25);
  animation: modalSlideUp 0.4s ease;
  position: relative;
}

.auth-gate-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 0;
}

.auth-gate-icon {
  width: 10rem;
  height: 10rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
  animation: lockPulse 2s ease-in-out infinite;
}

@keyframes lockPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.5);
  }
}

.auth-gate-icon i {
  font-size: 4rem;
  color: #fff;
}

.auth-gate-title {
  font-size: 2.4rem;
  font-weight: 700;
  color: #1a8b6d;
  margin-bottom: 1rem;
}

.auth-gate-message {
  font-size: 1.6rem;
  color: #666;
  line-height: 1.7;
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

.auth-gate-buttons {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.auth-gate-btn {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.4rem 3rem;
  font-size: 1.5rem;
  font-weight: 600;
  border-radius: 5rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.auth-gate-register {
  background: linear-gradient(135deg, #1a8b6d 0%, #2ecc71 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(26, 139, 109, 0.3);
}

.auth-gate-register:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(26, 139, 109, 0.4);
  color: #fff;
}

.auth-gate-login {
  background: #fff;
  color: #1a8b6d;
  border: 2px solid #1a8b6d;
}

.auth-gate-login:hover {
  background: #1a8b6d;
  color: #fff;
  transform: translateY(-3px);
}

.auth-gate-note {
  font-size: 1.3rem;
  color: #888;
  font-style: italic;
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .media-controls {
    flex-direction: column;
  }

  .step-line {
    width: 4rem;
  }

  .step span {
    font-size: 1rem;
  }

  .device-selection {
    flex-direction: column;
    gap: 1rem;
  }

  .auth-gate-buttons {
    flex-direction: column;
    width: 100%;
  }

  .auth-gate-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .test-modal,
  .personal-data-modal,
  .recording-modal,
  .confirmation-modal,
  .analyzing-modal,
  .auth-gate-modal {
    padding: 2rem;
    border-radius: 1.5rem;
    margin: 1rem;
  }

  .step-progress {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .step-line {
    display: none;
  }

  .success-cards {
    flex-direction: column;
    align-items: center;
  }

  .success-card {
    width: 12rem;
    height: 12rem;
  }

  .gender-options {
    flex-direction: column;
  }

  .analyzing-box {
    width: 18rem;
    height: 18rem;
  }

  .rotating-ring {
    width: 14rem;
    height: 14rem;
  }

  .center-icon {
    width: 8rem;
    height: 8rem;
  }

  .auth-gate-icon {
    width: 8rem;
    height: 8rem;
  }

  .auth-gate-icon i {
    font-size: 3rem;
  }

  .auth-gate-title {
    font-size: 2rem;
  }

  .auth-gate-message {
    font-size: 1.4rem;
  }
}
