/* Theme variables - Light mode (default) */
:root {
  --reg-bg: #f0f0f0;
  --reg-card-bg: #ffffff;
  --reg-text: #1f2937;
  --reg-text-muted: #6b7280;
  --reg-text-label: #374151;
  --reg-border: #e5e7eb;
  --reg-input-bg: #ffffff;
  --reg-input-focus: #3b82f6;
  --reg-primary-gradient-start: #1e40af;
  --reg-primary-gradient-end: #3b82f6;
  --reg-accent: #60a5fa;
  /* Warning: Red/coral to match dark mode */
  --reg-warning-bg: #fef2f2;
  --reg-warning-border: #f87171;
  --reg-warning-text: #991b1b;
  --reg-info-bg: #eff6ff;
  --reg-info-border: #bfdbfe;
  --reg-info-text: #1d4ed8;
  --reg-error: #dc2626;
  --reg-error-bg: #fef2f2;
  --reg-error-border: #fecaca;
  --reg-success: #10b981;
  --reg-success-dark: #059669;
  --reg-success-bg: #f0fdf4;
  --reg-success-border: #bbf7d0;
  --reg-success-text: #166534;
  --reg-modal-bg: #ffffff;
  --reg-modal-header: #1e40af;
  --reg-lang-bg: rgba(255, 255, 255, 0.95);
  --reg-lang-hover: #f3f4f6;
  --reg-shadow: rgba(0, 0, 0, 0.1);
  --reg-logo-filter: grayscale(100%);
  --reg-btn-primary-bg: #4f46e5;
  --reg-btn-primary-hover: #4338ca;
  --reg-btn-secondary-bg: #e5e7eb;
  --reg-btn-secondary-text: #374151;
  --reg-btn-secondary-hover: #d1d5db;
  --reg-disabled-bg: #f3f4f6;
  --reg-disabled-text: #9ca3af;
  --reg-review-modal-label: #555555;
  --reg-review-modal-readonly-bg: #f5f5f5;
  --reg-review-modal-readonly-text: #666666;
  --reg-review-success-bg: #d1fae5;
  --reg-review-success-text: #065f46;
  --reg-review-error-bg: #fee2e2;
  --reg-review-error-text: #991b1b;
}

/* Dark mode - matching webvault */
html.dark {
  --reg-bg: #0d1421;
  --reg-card-bg: #1e293b;
  --reg-text: #f1f5f9;
  --reg-text-muted: #94a3b8;
  --reg-text-label: #cbd5e1;
  --reg-border: #374151;
  --reg-input-bg: #1e293b;
  --reg-input-focus: #60a5fa;
  /* Left panel uses dark gradient like webvault sidebar */
  --reg-primary-gradient-start: #0d1421;
  --reg-primary-gradient-end: #1a2744;
  --reg-accent: #60a5fa;
  /* Warning: Option 2 - Red/coral (classic danger feel) */
  --reg-warning-bg: rgba(220, 38, 38, 0.15);
  --reg-warning-border: #f87171;
  --reg-warning-text: #fca5a5;
  --reg-info-bg: #1e3a5f;
  --reg-info-border: #3b82f6;
  --reg-info-text: #93c5fd;
  --reg-error: #f87171;
  --reg-error-bg: #450a0a;
  --reg-error-border: #7f1d1d;
  --reg-success: #34d399;
  --reg-success-dark: #10b981;
  --reg-success-bg: #052e16;
  --reg-success-border: #166534;
  --reg-success-text: #86efac;
  --reg-modal-bg: #1e293b;
  --reg-modal-header: #60a5fa;
  --reg-lang-bg: rgba(30, 41, 59, 0.95);
  --reg-lang-hover: #253449;
  --reg-shadow: rgba(0, 0, 0, 0.3);
  --reg-logo-filter: grayscale(100%) invert(1);
  --reg-form-logo-filter: brightness(0) invert(1);
  --reg-btn-primary-bg: #4f46e5;
  --reg-btn-primary-hover: #6366f1;
  --reg-btn-secondary-bg: #374151;
  --reg-btn-secondary-text: #e5e7eb;
  --reg-btn-secondary-hover: #4b5563;
  --reg-disabled-bg: #374151;
  --reg-disabled-text: #6b7280;
  --reg-review-modal-label: #94a3b8;
  --reg-review-modal-readonly-bg: #374151;
  --reg-review-modal-readonly-text: #94a3b8;
  --reg-review-success-bg: #052e16;
  --reg-review-success-text: #86efac;
  --reg-review-error-bg: #450a0a;
  --reg-review-error-text: #fca5a5;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: var(--reg-bg);
  min-height: 100vh;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240vw;
  max-width: 1800px;
  aspect-ratio: 1366 / 768;
  background: url('/public/images/Heimlane_logo.svg') no-repeat center center;
  background-size: contain;
  opacity: 0.15;
  filter: var(--reg-logo-filter);
  pointer-events: none;
  z-index: 0;
}

/* Language Selector */
.lang-selector {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--reg-lang-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--reg-border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 12px var(--reg-shadow);
  display: flex;
  align-items: center;
}

.lang-button {
  background: none;
  border: none;
  padding: 6px 10px;
  margin: 0 2px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  color: var(--reg-text-muted);
}

.lang-button.active {
  background: var(--reg-input-focus);
  color: white;
}

.lang-button:hover:not(.active) {
  background: var(--reg-lang-hover);
  color: var(--reg-text-label);
}

.container {
  background: var(--reg-card-bg);
  border-radius: 20px;
  box-shadow: 0 20px 40px var(--reg-shadow);
  overflow: hidden;
  max-width: 900px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 650px;
  position: relative;
  z-index: 1;
}

.left-panel {
  background: linear-gradient(135deg, var(--reg-primary-gradient-start) 0%, var(--reg-primary-gradient-end) 100%);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.tagline {
  font-size: 18px;
  font-weight: 300;
  margin-bottom: 30px;
  line-height: 1.4;
}

.features {
  list-style: none;
}

.features li {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  font-size: 14px;
}

.features li::before {
  content: "✓";
  margin-right: 12px;
  font-weight: bold;
  color: #60a5fa;
  font-size: 16px;
}

.learn-more-btn {
  background: none;
  border: 1px solid #60a5fa;
  color: #60a5fa;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.learn-more-btn:hover {
  background: #60a5fa;
  color: white;
}

.right-panel {
  padding: 40px;
  overflow-y: auto;
}

.form-header {
  text-align: center;
  margin-bottom: 30px;
}

.form-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--reg-text);
  margin-bottom: 8px;
}

.form-subtitle {
  color: var(--reg-text-muted);
  font-size: 14px;
}

/* NEW: Form logo styling */
.form-logo {
  height: 180px;
  margin-bottom: 15px;
  margin-left: auto;
  margin-right: auto;
}

/* Light/dark logo switching */
.form-logo-light {
  display: block;
}

.form-logo-dark {
  display: none;
}

html.dark .form-logo-light {
  display: none;
}

html.dark .form-logo-dark {
  display: block;
}

.warning-box {
  background: var(--reg-warning-bg);
  border: 2px solid var(--reg-warning-border);
  border-radius: 12px;
  padding: 15px;
  margin: 20px 0;
  font-size: 12px;
}

.warning-title {
  font-weight: 600;
  color: var(--reg-warning-text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}

.warning-title::before {
  content: "⚠️";
  margin-right: 6px;
}

.warning-text {
  color: var(--reg-warning-text);
  line-height: 1.4;
}

.email-notice {
  background: var(--reg-info-bg);
  border: 1px solid var(--reg-info-border);
  border-radius: 8px;
  padding: 10px;
  margin: 15px 0;
  font-size: 12px;
  color: var(--reg-info-text);
}

/* NEW: Hidden email notice */
.email-notice-hidden {
  display: none;
}

.form-group {
  margin-bottom: 20px;
}

/* Anti-automation - positioned off-screen, not display:none */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--reg-text-label);
  font-size: 13px;
}

/* NEW: Bold label */
.label-bold {
  font-weight: 500;
}

.required {
  color: var(--reg-error);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--reg-border);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: var(--reg-input-bg);
  color: var(--reg-text);
}

/* Placeholder styling for dark mode visibility */
input::placeholder,
textarea::placeholder {
  color: var(--reg-text-muted);
  opacity: 0.8;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--reg-input-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Password field states */
.password-field-invalid {
  border-color: var(--reg-error) !important;
  border-width: 2px !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.password-field-valid {
  border-color: var(--reg-success) !important;
  border-width: 2px !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.password-container {
  position: relative;
}

.password-strength {
  margin-top: 8px;
  height: 4px;
  background: var(--reg-border);
  border-radius: 2px;
  overflow: hidden;
  display: none;
}

.password-strength.show {
  display: block;
}

#passwordStrengthBar {
  height: 100%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-weak { background: var(--reg-error); }
.strength-fair { background: #f97316; }
.strength-good { background: var(--reg-success); }
.strength-strong { background: var(--reg-success-dark); }

.password-feedback {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#passwordStrengthText {
  font-size: 12px;
  font-weight: 600;
}

#passwordRequirements {
  margin-top: 10px;
  font-size: 12px;
  color: var(--reg-text-muted);
  display: none;
}

.requirement {
  margin-bottom: 4px;
}

.requirement.met {
  color: var(--reg-success);
  font-weight: 500;
}

.error-field {
  color: var(--reg-error);
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
}

/* NEW: Checkbox spacing for warning */
.checkbox-warning-spacing {
  margin-top: 15px;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin-right: 10px;
  margin-top: 2px;
}

.checkbox-group label {
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

/* NEW: Hidden form container */
.form-container-hidden {
  display: none;
}

/* Password hint opt-out checkbox styling */
.hint-optout-spacing {
  margin-top: 12px;
  margin-bottom: 0;
}

.hint-optout-label {
  font-size: 11px;
  color: var(--reg-text-muted);
}

/* Disabled/grayed out password hint field */
.password-hint-disabled {
  background: var(--reg-disabled-bg) !important;
  color: var(--reg-disabled-text) !important;
  cursor: not-allowed !important;
}

/* NEW: Country other field */
.country-other-field {
  margin-top: 8px;
  display: none;
}

/* NEW: Blue link styling */
.link-blue {
  color: var(--reg-accent);
}

button[type="submit"] {
  width: 100%;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
}

button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  margin-top: 15px;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  display: none;
}

.status.show {
  display: block;
}

.status.error {
  background: var(--reg-error-bg);
  border: 1px solid var(--reg-error-border);
  color: var(--reg-error);
}

.status.success {
  background: var(--reg-success-bg);
  border: 1px solid var(--reg-success-border);
  color: var(--reg-success-text);
}

.status.info {
  background: var(--reg-info-bg);
  border: 1px solid var(--reg-info-border);
  color: var(--reg-info-text);
}

/* 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);
}

.modal-content {
  background-color: var(--reg-modal-bg);
  margin: 10% auto;
  padding: 30px;
  border-radius: 12px;
  width: 80%;
  max-width: 600px;
  box-shadow: 0 10px 25px var(--reg-shadow);
}

.modal-header {
  font-size: 20px;
  font-weight: 600;
  color: var(--reg-modal-header);
  margin-bottom: 15px;
}

.modal-body {
  color: var(--reg-text-label);
  line-height: 1.6;
  font-size: 14px;
}

/* NEW: Modal list styling */
.modal-list {
  margin: 15px 0;
  padding-left: 20px;
}

.close {
  color: var(--reg-text-muted);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  margin-top: -10px;
}

.close:hover {
  color: var(--reg-modal-header);
}

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

  .left-panel {
    padding: 30px;
    text-align: center;
  }

  .right-panel {
    padding: 30px;
    padding-bottom: 50px; /* Account for fixed footer */
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .lang-selector {
    top: 10px;
    right: 10px;
    padding: 6px;
  }

  .lang-button {
    padding: 4px 6px;
    font-size: 11px;
  }
}

/* ============================================================================
   DISPOSABLE EMAIL ERROR STYLES
   ============================================================================ */

.disposable-email-error {
  text-align: left;
}

.disposable-email-error p {
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.review-request-btn {
  background: transparent;
  border: 1px solid var(--reg-error);
  color: var(--reg-error);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.review-request-btn:hover {
  background: var(--reg-error);
  color: white;
}

/* Review Request Modal */
.review-modal-content {
  max-width: 450px;
  width: 90%;
}

.review-modal-content h3 {
  margin: 0 0 20px 0;
  color: var(--reg-text);
  font-size: 18px;
}

.review-modal-content .form-group {
  margin-bottom: 16px;
}

.review-modal-content label {
  display: block;
  margin-bottom: 6px;
  color: var(--reg-review-modal-label);
  font-size: 14px;
}

.review-modal-content input[type="email"],
.review-modal-content textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--reg-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  background: var(--reg-input-bg);
  color: var(--reg-text);
}

.review-modal-content input[readonly] {
  background: var(--reg-review-modal-readonly-bg);
  color: var(--reg-review-modal-readonly-text);
}

.review-modal-content textarea {
  resize: vertical;
  min-height: 80px;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background: var(--reg-btn-primary-hover);
}

.btn-primary:disabled {
  background: var(--reg-disabled-text);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--reg-btn-secondary-bg);
  color: var(--reg-btn-secondary-text);
}

.btn-secondary:hover {
  background: var(--reg-btn-secondary-hover);
}

.review-status {
  margin-top: 16px;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}

.review-status.success {
  background: var(--reg-review-success-bg);
  color: var(--reg-review-success-text);
}

.review-status.error {
  background: var(--reg-review-error-bg);
  color: var(--reg-review-error-text);
}

/* ============================================================================
   THEME TOGGLE STYLES
   ============================================================================ */

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--reg-text-muted);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--reg-lang-hover);
  color: var(--reg-text);
}

/* Show sun in dark mode, moon in light mode */
.icon-sun { display: none; }
.icon-moon { display: block; }

html.dark .icon-sun { display: block; }
html.dark .icon-moon { display: none; }

/* Divider between theme toggle and language buttons */
.lang-divider {
  width: 1px;
  height: 20px;
  background: var(--reg-border);
  margin: 0 4px;
}

/* Smooth theme transition */
html, body, .container, .right-panel, .lang-selector,
input, select, textarea, .modal-content, .warning-box, .email-notice {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ============================================================================
   PAGE FOOTER
   ============================================================================ */

.page-footer {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  font-size: 11px;
  color: var(--reg-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-footer a {
  color: var(--reg-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.page-footer a:hover {
  color: var(--reg-accent);
  text-decoration: underline;
}

.footer-separator {
  color: var(--reg-border);
}