/* Main styles for the form application */
:root {
  --primary-color: #007bff;
  --primary-hover: #0069d9;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --body-bg: #f5f5f5;
  --white: #ffffff;
  --black: #000000;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  
  /* Light theme variables (default) */
  --bg-color: #f5f5f5;
  --text-color: #343a40;
  --container-bg: #ffffff;
  --border-color: #dee2e6;
  --input-bg: #ffffff;
  --input-border: #ced4da;
  --dropdown-bg: #ffffff;
  --dropdown-hover: #f8f9fa;
  --file-upload-border: #dee2e6;
}

/* Dark theme variables */
[data-theme="dark"] {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --container-bg: #1e1e1e;
  --border-color: #444444;
  --input-bg: #2d2d2d;
  --input-border: #444444;
  --dropdown-bg: #2d2d2d;
  --dropdown-hover: #3d3d3d;
  --file-upload-border: #444444;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  line-height: 1.6;
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
}

.form-container {
  background-color: var(--container-bg);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 40px 30px;
  margin: 30px auto;
  max-width: 700px;
  transition: background-color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-color);
  margin-bottom: 20px;
}

h1 {
  font-size: 28px;
  text-align: center;
}

h2 {
  font-size: 24px;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--gray-700);
}

input[type="text"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.2s;
  background-color: var(--input-bg);
  color: var(--text-color);
}

input[type="text"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.error-message {
  color: var(--danger-color);
  font-size: 14px;
  margin-top: 5px;
}

/* File upload area */
.file-upload {
  border: 2px dashed var(--file-upload-border);
  border-radius: 4px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  background-color: var(--input-bg);
}

.file-upload:hover {
  border-color: var(--primary-color);
}

.file-upload-text {
  margin-bottom: 10px;
  font-weight: 500;
}

.file-format-text {
  color: var(--gray-600);
  font-size: 14px;
}

.image-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.image-preview {
  position: relative;
  width: 100px;
  height: 100px;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-image {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(0, 0, 0, 0.5);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.remove-image:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Buttons */
.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 12px 24px;
  font-size: 16px;
  line-height: 1.5;
  border-radius: 4px;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
  cursor: pointer;
}

.btn-primary {
  color: var(--white);
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-primary:disabled {
  background-color: var(--gray-500);
  border-color: var(--gray-500);
  cursor: not-allowed;
  opacity: 0.8;
}

.btn-full {
  width: 100%;
}

/* Form header styling */
.form-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.header-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.form-header h1 {
  margin-bottom: 0;
  text-align: center;
}

/* Language selector */
.language-selector {
  position: relative;
  display: inline-block;
  margin-bottom: 0;
  z-index: 1000;
}

.language-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 140px;
  padding: 10px 15px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--dropdown-bg);
  color: var(--text-color);
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
  font-weight: 500;
}

.language-dropdown-toggle:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.language-dropdown-toggle svg {
  margin-left: 10px;
}

.language-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 160px;
  background-color: var(--dropdown-bg);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
}

.language-dropdown-item {
  padding: 12px 15px;
  cursor: pointer;
  color: var(--text-color);
  transition: background-color 0.2s;
  font-weight: 500;
}

.language-dropdown-item:hover {
  background-color: var(--dropdown-hover);
}

.language-dropdown-item.active {
  background-color: rgba(0, 123, 255, 0.1);
  color: var(--primary-color);
  font-weight: 600;
}

/* Theme selector */
.theme-selector {
  position: relative;
  display: inline-block;
  margin-bottom: 0;
  z-index: 1000;
}

.theme-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 160px;
  padding: 10px 15px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--dropdown-bg);
  color: var(--text-color);
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
  font-weight: 500;
}

.theme-dropdown-toggle:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.theme-dropdown-toggle svg {
  margin-left: 10px;
}

.theme-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 210px;
  background-color: var(--dropdown-bg);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
}

.theme-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  cursor: pointer;
  color: var(--text-color);
  transition: background-color 0.2s;
  font-weight: 500;
}

.theme-dropdown-item:hover {
  background-color: var(--dropdown-hover);
}

.theme-dropdown-item.active {
  background-color: rgba(0, 123, 255, 0.1);
  color: var(--primary-color);
  font-weight: 600;
}

.theme-dropdown-item .theme-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

/* Dark theme specific styles */
[data-theme="light"] .theme-dropdown-item {
  color: #343a40;
}

[data-theme="light"] .theme-dropdown-item:hover {
  color: #ffffff;
}

[data-theme="dark"] .theme-dropdown-item.active {
  color: var(--primary-color);
}

/* Theme switch */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-switch {
  display: inline-block;
  height: 24px;
  position: relative;
  width: 48px;
}

.theme-switch input {
  display: none;
}

.slider {
  background-color: #ccc;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  background-color: white;
  bottom: 4px;
  content: "";
  height: 16px;
  left: 4px;
  position: absolute;
  transition: .4s;
  width: 16px;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.theme-icon {
  font-size: 18px;
  cursor: pointer;
}

/* Success message */
.success-container {
  text-align: center;
  padding: 30px;
}

.success-icon {
  color: var(--success-color);
  font-size: 48px;
  margin-bottom: 20px;
}

.success-title {
  color: var(--success-color);
  font-size: 24px;
  margin-bottom: 15px;
}

.success-message {
  margin-bottom: 30px;
}

/* Verification form */
.verification-form {
  max-width: 300px;
  margin: 0 auto;
}

.verification-phone {
  text-align: center;
  margin: -10px 0 20px 0;
  color: var(--gray-600);
  font-size: 24px;
}

[data-theme="dark"] .verification-phone {
  color: var(--gray-500);
}

.verification-code-input {
  text-align: center;
  letter-spacing: 8px;
  font-size: 24px;
}

.resend-link {
  display: block;
  text-align: center;
  margin-top: 15px;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}

/* Countdown Timer Styles */
.countdown-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.countdown-timer {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.countdown-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.countdown-circle-bg {
  fill: none;
  stroke: var(--gray-300);
  stroke-width: 4;
}

[data-theme="dark"] .countdown-circle-bg {
  stroke: var(--gray-700);
}

.countdown-circle {
  fill: none;
  stroke: var(--primary-color);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 283; /* 2 * PI * 45 (circle radius) */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.countdown-text {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-color);
  z-index: 1;
}

.countdown-info {
  margin-top: 15px;
  font-size: 14px;
  text-align: center;
  color: var(--gray-600);
  max-width: 220px;
  z-index: 1;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .form-container {
    padding: 20px;
    margin: 10px;
  }
  
  .form-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .form-header h1 {
    margin-bottom: 15px;
    width: 100%;
  }
  
  .language-dropdown-toggle {
    width: 100px;
    padding: 8px 12px;
  }
  
  .language-dropdown-menu {
    width: 140px;
  }
  
  .form-controls {
    flex-direction: column;
    gap: 10px;
  }
}

/* Form-wide Error */
#form-error, #verification-error {
  margin-bottom: 20px;
  text-align: center;
  padding: 10px;
  border-radius: 4px;
  background-color: rgba(220, 53, 69, 0.1);
}

/* Checkbox styles */
.checkbox-group {
  margin: 20px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-color);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:not(:checked) {
  border: 2px solid var(--border-color);
}

.checkbox-label input[type="checkbox"]:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-content {
  background-color: var(--container-bg);
  margin: 5% auto;
  padding: 0;
  width: 80%;
  max-width: 900px;
  height: 80%;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

/* Mobile Modal Styles */
@media (max-width: 768px) {
  .modal-content {
    margin: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
  }
  
  .modal-body {
    max-height: calc(100vh - 60px);
  }
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-color);
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-color);
  padding: 0;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
  color: var(--text-color);
}

.modal-body p {
  margin-bottom: 15px;
  line-height: 1.5;
}

.modal-body .preparing-message {
  text-align: center;
  font-size: 18px;
  padding: 40px 20px;
  color: var(--text-color);
}

.modal-body iframe {
  border: none;
  width: 100%;
  height: 100%;
}

/* Privacy Policy Link */
.privacy-policy-link {
  color: var(--primary-color);
  text-decoration: none;
  margin-left: 5px;
  font-size: 0.9em;
}

.privacy-policy-link:hover {
  text-decoration: underline;
}

/* Privacy Policy Text */
.privacy-policy-text {
  color: var(--text-color);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--primary-color);
  text-underline-offset: 2px;
}

.privacy-policy-text:hover {
  color: var(--primary-color);
}

/* General link styles */
a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Dark theme specific link styles */
[data-theme="dark"] a {
  color: var(--primary-color);
}

[data-theme="dark"] a:hover {
  color: var(--primary-hover);
}

/* Light theme specific link styles */
[data-theme="light"] a {
  color: var(--primary-color);
}

[data-theme="light"] a:hover {
  color: var(--primary-hover);
}

/* Phone input with intl-tel-input */
.iti {
  width: 100%;
  display: block;
}

.iti__flag-container {
  z-index: 10;
}

/* Customize the dropdown menu to match our theme */
.iti__country-list {
  background-color: var(--dropdown-bg);
  border-color: var(--border-color);
  color: var(--text-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.iti__country:hover {
  background-color: var(--dropdown-hover);
}

.iti__country.iti__highlight {
  background-color: rgba(0, 123, 255, 0.1);
}

.iti__selected-flag {
  background-color: var(--input-bg);
}

.iti__selected-flag:hover {
  background-color: var(--dropdown-hover);
}

/* Dark theme adjustments */
[data-theme="dark"] .iti__selected-flag {
  background-color: var(--input-bg);
}

[data-theme="dark"] .iti__country-list {
  background-color: var(--dropdown-bg);
  color: var(--text-color);
}

[data-theme="dark"] .iti__country.iti__highlight {
  background-color: rgba(0, 123, 255, 0.1);
}

/* Remove the old styles for phone input with country code */
.phone-input-container {
  display: none;
}

.country-code-select {
  display: none;
}

.phone-input {
  display: none;
}