/**
 * ABATUR Hotel Booking - Transfers Module Styles (Refactored)
 *
 * @package ABATUR_Hotel_Booking
 * @subpackage Assets/CSS
 * @since 1.8.0
 * @author Copilot/Gemini
 */

/* =============================================================================
   Override: Force light theme & hide duplicate elements
   ========================================================================== */

/* Disable dark mode for transfers form */
@media (prefers-color-scheme: dark) {
  .ahb-transfer-form-container,
  .ahb-booking-form {
    background: #ffffff !important;
    color: #1f2937 !important;
  }
}

/* Hide duplicate language indicator */
.ahb-form-language-indicator {
  display: none !important;
}

/* =============================================================================
   Design System (CSS Variables)
   ========================================================================== */

:root {
  --ahb-primary-color: #2e1a47; /* Cliente Primary */
  --ahb-primary-hover: #6a0a41;
  --ahb-text-primary: #1f2937;   /* Gray 800 */
  --ahb-text-secondary: #4b5563; /* Gray 600 */
  --ahb-border-color: #d1d5db;   /* Gray 300 */
  --ahb-border-focus: var(--ahb-primary-color);
  --ahb-background-light: #f9fafb; /* Gray 50 */
  --ahb-background-white: #ffffff;
  --ahb-error-color: #dc2626;
  --ahb-success-color: #059669;

  --ahb-font-family: inherit; /* Inherit from WordPress theme */
  --ahb-font-size-base: 1rem;
  --ahb-line-height-base: 1.5;

  --ahb-border-radius: 8px;
  --ahb-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --ahb-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  
  --ahb-spacing-1: 0.25rem;
  --ahb-spacing-2: 0.5rem;
  --ahb-spacing-3: 0.75rem;
  --ahb-spacing-4: 1rem;
  --ahb-spacing-6: 1.5rem;
  --ahb-spacing-8: 2rem;
}

/* =============================================================================
   Base Form Styles (Mobile-First)
   ========================================================================== */

.ahb-transfer-form-container,
.ahb-booking-form {
  font-family: var(--ahb-font-family);
  font-size: var(--ahb-font-size-base);
  line-height: var(--ahb-line-height-base);
  color: var(--ahb-text-primary);
  background-color: var(--ahb-background-white);
}

.ahb-transfer-form-container {
  max-width: 720px;
  margin: var(--ahb-spacing-8) auto;
  border: 1px solid var(--ahb-border-color);
  border-radius: var(--ahb-border-radius);
  box-shadow: var(--ahb-shadow-md);
  overflow: hidden;
}

.ahb-form-header,
.ahb-form-section {
  padding: var(--ahb-spacing-6);
}

.ahb-form-header {
  background-color: var(--ahb-background-light);
  border-bottom: 1px solid var(--ahb-border-color);
}

.ahb-form-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 var(--ahb-spacing-2) 0;
}

.ahb-transfer-description {
  color: var(--ahb-text-secondary);
  margin: 0;
}

.ahb-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 var(--ahb-spacing-6) 0;
  padding-bottom: var(--ahb-spacing-3);
  border-bottom: 1px solid var(--ahb-border-color);
  display: flex;
  align-items: center;
  gap: var(--ahb-spacing-3);
}

/* Optional: For subtle SVG icons */
.ahb-section-title .icon {
  width: 1em;
  height: 1em;
  color: var(--ahb-text-secondary);
}

/* =============================================================================
   Form Grid and Groups
   ========================================================================== */

.ahb-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ahb-spacing-6);
}

.ahb-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--ahb-spacing-2);
}

.ahb-form-group label {
  font-weight: 500;
  color: var(--ahb-text-primary);
}

.ahb-form-group input,
.ahb-form-group select,
.ahb-form-group textarea {
  width: 100%;
  padding: var(--ahb-spacing-3) var(--ahb-spacing-4);
  border: 1px solid var(--ahb-border-color);
  border-radius: var(--ahb-border-radius);
  background-color: var(--ahb-background-white);
  color: var(--ahb-text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ahb-form-group input:focus,
.ahb-form-group select:focus,
.ahb-form-group textarea:focus {
  outline: none;
  border-color: var(--ahb-border-focus);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.ahb-form-group input::placeholder,
.ahb-form-group textarea::placeholder {
  color: #9ca3af; /* Gray 400 */
  opacity: 1;
}

.ahb-form-help {
  color: var(--ahb-text-secondary);
  font-size: 0.875rem;
  margin-top: var(--ahb-spacing-1);
}

/* =============================================================================
   Custom Radio Buttons (Transfer Mode)
   ========================================================================== */

.ahb-transfer-modes {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ahb-spacing-4);
}

.ahb-radio-option {
  display: flex;
  align-items: flex-start;
  gap: var(--ahb-spacing-4);
  padding: var(--ahb-spacing-4);
  border: 1px solid var(--ahb-border-color);
  border-radius: var(--ahb-border-radius);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ahb-radio-option:hover {
  border-color: var(--ahb-primary-color);
}

.ahb-radio-option input[type="radio"] {
  margin-top: 0.25em; /* Align with first line of text */
  accent-color: var(--ahb-primary-color);
}

.ahb-radio-option:has(input[type="radio"]:checked) {
  border-color: var(--ahb-primary-color);
  background-color: var(--ahb-background-light);
}

.ahb-radio-label strong {
  font-weight: 500;
}

.ahb-radio-label small {
  color: var(--ahb-text-secondary);
  font-size: 0.875rem;
}

/* =============================================================================
   Submit Button
   ========================================================================== */

.ahb-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background-color: var(--ahb-primary-color);
  color: var(--ahb-background-white);
  border: none;
  border-radius: var(--ahb-border-radius);
  padding: var(--ahb-spacing-3) var(--ahb-spacing-6);
  font-size: var(--ahb-font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  min-height: 44px;
}

.ahb-submit-btn:hover:not(:disabled) {
  background-color: var(--ahb-primary-hover);
}

.ahb-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =============================================================================
   Validation & Notices
   ========================================================================== */

.ahb-form-group input.error,
.ahb-form-group select.error,
.ahb-form-group textarea.error {
  border-color: var(--ahb-error-color);
}

.ahb-field-error {
  color: var(--ahb-error-color);
  font-size: 0.875rem;
}

.ahb-success-message,
.ahb-error-message {
  padding: var(--ahb-spacing-4);
  border-radius: var(--ahb-border-radius);
  margin-top: var(--ahb-spacing-6);
  border: 1px solid transparent;
}

.ahb-success-message {
  background-color: #f0fdf4; /* Green 50 */
  color: #15803d; /* Green 700 */
  border-color: var(--ahb-success-color);
}

.ahb-error-message {
  background-color: #fef2f2; /* Red 50 */
  color: #b91c1c; /* Red 700 */
  border-color: var(--ahb-error-color);
}

/* =============================================================================
   Responsive Design (Mobile-First)
   ========================================================================== */

/* Tablet and larger */
@media (min-width: 768px) {
  .ahb-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ahb-form-group.full-width {
    grid-column: 1 / -1;
  }

  .ahb-transfer-modes {
    grid-template-columns: repeat(3, 1fr);
  }

  .ahb-submit-btn {
    width: auto;
    min-width: 200px;
  }
}

/* =============================================================================
   Form Closed Notice - v2.0.16
   Shown when the event's auto-deactivation deadline has passed
   ========================================================================== */

.ahb-form-closed-notice {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--ahb-border-radius, 12px);
  padding: 40px 30px;
  text-align: center;
  max-width: 500px;
  margin: 40px auto;
}

.ahb-form-closed-notice h3 {
  color: #991b1b;
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
}

.ahb-form-closed-notice p {
  color: #7f1d1d;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}