/* ===== FORM LAYOUT ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  background: var(--bg-primary);
}

.auth-container {
  width: 100%;
  max-width: 520px;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-logo-text {
  font-size: 1.5rem;
  font-weight: 900;
}

.auth-logo-text span {
  color: var(--orange);
}

.auth-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: var(--space-2xl);
}

/* ===== PROFILE SELECTION ===== */
.profile-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.profile-option {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.profile-option:hover {
  border-color: var(--border-light);
}

.profile-option.selected {
  border-color: var(--orange);
  background: var(--orange-light);
}

.profile-option-icon {
  font-size: 1.8rem;
  margin-bottom: var(--space-sm);
}

.profile-option-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.profile-option-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ===== FORM INPUTS ===== */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-input:hover:not(:disabled):not(:focus),
.form-select:hover:not(:disabled):not(:focus),
.form-textarea:hover:not(:disabled):not(:focus) {
  border-color: var(--border-light, rgba(255,255,255,0.18));
  background: var(--bg-tertiary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-light);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-input-error,
.form-input.error,
.form-select.error {
  border-color: var(--red) !important;
}

.form-error {
  color: var(--red);
  font-size: 0.8rem;
  margin-top: 4px;
}

.form-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Select : chevron custom + état pro */
.form-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23F59E0B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px;
}

.form-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23F59E0B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='18 15 12 9 6 15'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Forcer le rendu sombre des options/optgroups (Chrome/Edge respectent) */
.form-select option,
.form-select optgroup {
  background: var(--bg-secondary, #161B22);
  color: var(--text-primary);
  padding: 10px;
}
.form-select optgroup {
  font-weight: 700;
  color: var(--orange);
  font-style: normal;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.form-select option {
  font-weight: 500;
}
.form-select option:disabled {
  color: var(--text-muted);
}

/* Inputs date/time : harmonisation chevron natif (Chromium) */
input.form-input[type="date"],
input.form-input[type="time"],
input.form-input[type="datetime-local"] {
  cursor: pointer;
}
input.form-input[type="date"]::-webkit-calendar-picker-indicator,
input.form-input[type="time"]::-webkit-calendar-picker-indicator,
input.form-input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8) sepia(1) saturate(8) hue-rotate(360deg) brightness(0.9);
  opacity: 0.85;
  cursor: pointer;
  padding: 2px;
}
input.form-input[type="date"]::-webkit-calendar-picker-indicator:hover,
input.form-input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Textarea : taille mini + resize ergonomique */
.form-textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.55;
}

/* Checkbox */
.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
  margin-top: 2px;
}

.form-checkbox-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== FORM ROW ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .profile-select { grid-template-columns: 1fr; }
}

/* ===== DIVIDER ===== */
.form-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== LINK ===== */
.form-link {
  color: var(--orange);
  font-size: 0.85rem;
  font-weight: 500;
}

.form-link:hover {
  text-decoration: underline;
}

/* ===== CODE INPUT (6 digits) ===== */
.code-input {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin: var(--space-lg) 0;
}

.code-input input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.code-input input:focus {
  outline: none;
  border-color: var(--orange);
}
