/* ============================================
   Pall Mall - Redesign matching reference
   ============================================ */

/* ---- Font Faces ---- */
@font-face {
  font-family: 'Gotham';
  src: url('../fonts/Gotham Book.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gotham';
  src: url('../fonts/Gotham-BookItalic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Gotham';
  src: url('../fonts/Gotham Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gotham';
  src: url('../fonts/Gotham Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gotham';
  src: url('../fonts/Gotham-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gotham';
  src: url('../fonts/Gotham Bold Italic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Gotham';
  src: url('../fonts/Gotham Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-navy: #002540;
  --color-navy-dark: #002540;
  --color-navy-light: #2a3d5c;
  --color-white: #ffffff;
  --color-dark: #000000;
  --color-off-white: #f7f7f7;
  --color-gray-light: #e0e0e0;
  --color-gray: #888888;
  --color-gray-dark: #555555;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-error: #d32f2f;
  --color-success: #2e7d32;

  --font-main: 'Gotham', 'Helvetica Neue', Arial, sans-serif;

  --radius-pill: 15px;
  --radius-sm: 4px;

  --transition-fast: 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-white);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ============================================
   Section 1: Banner
   ============================================ */
.section-banner {
  width: 100%;
  position: relative;
  overflow: hidden;
  background-color: var(--color-navy-dark);
}

.section-banner img {
  width: 100%;
  display: block;
  object-fit: cover;
}

/* ============================================
   Section 2: Terms link + Warning bar
   ============================================ */
.section-terms-link {
  width: 100%;
  background-color: var(--color-white);
  text-align: center;
  padding: 8px 20px;
}

.section-terms-link p {
  color: var(--color-text);
  font-weight: 600;
}

.section-warning {
  width: 100%;
  background-color: var(--color-dark);
  padding: 14px 20px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.section-warning p {
  color: var(--color-white);
  font-size: clamp(0.7rem, 1.5vw, 3rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7em;
  margin: 0;
}

/* ============================================
   Section 3: Form Section (Two Columns)
   ============================================ */
.section-form {
  width: 100%;
  background-color: var(--color-navy-dark);
  padding: 40px 0 60px;
}

.section-form__container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* ---- Left Column: Form Fields ---- */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Two-column rows */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  position: relative;
}

.form-group label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 6px;
}

.form-group label .required {
  color: var(--color-error);
  margin-left: 1px;
}

.form-group input {
  width: 100%;
  padding: 10px 20px;
  background: var(--color-white);
  border: 2px solid var(--color-navy);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 400;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input::placeholder {
  color: var(--color-gray);
  font-weight: 300;
}

.form-group input:focus {
  border-color: var(--color-navy-light);
  box-shadow: 0 0 0 3px rgba(26, 39, 68, 0.1);
}

.form-group input.invalid {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.form-group input.valid {
  border-color: var(--color-success);
}

/* ============================================
   Custom Date Picker
   ============================================ */
.datepicker-wrapper {
  position: relative;
}

.datepicker-wrapper input {
  cursor: pointer;
  padding-right: 44px !important;
}

.datepicker-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-navy);
  pointer-events: none;
  opacity: 0.6;
}

.datepicker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 300px;
  background: var(--color-white);
  border: 2px solid var(--color-navy);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  z-index: 100;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0s linear 0.2s, border-width 0s linear 0.2s;
  overflow: hidden;
  max-height: 0;
  border-width: 0;
}

.datepicker-dropdown.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  max-height: 500px;
  border-width: 2px;
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0s, border-width 0s;
}

.datepicker-dropdown.dp-above {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom center;
}

.datepicker-dropdown.dp-above:not(.active) {
  transform: translateY(8px) scale(0.97);
}

.datepicker-dropdown.dp-align-right {
  left: auto;
  right: 0;
}

/* Header */
.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  background: var(--color-navy);
}

.dp-header__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-white);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s;
  text-transform: capitalize;
  user-select: none;
}

.dp-header__title:hover {
  background: rgba(255, 255, 255, 0.15);
}

.dp-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
  line-height: 1;
}

.dp-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Weekday labels */
.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 10px 12px 4px;
  gap: 0;
}

.dp-weekdays span {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.5;
}

/* Days grid */
.dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 4px 12px 12px;
  gap: 2px;
}

.dp-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: none;
  background: none;
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}

.dp-day:hover:not(.dp-day--disabled):not(.dp-day--other) {
  background: rgba(0, 37, 64, 0.1);
  transform: scale(1.1);
}

.dp-day--other {
  color: var(--color-gray-light);
  pointer-events: none;
}

.dp-day--today {
  border: 1.5px solid var(--color-navy);
  font-weight: 700;
}

.dp-day--selected {
  background: var(--color-navy) !important;
  color: var(--color-white) !important;
  font-weight: 700;
  transform: scale(1.1);
}

.dp-day--disabled {
  color: var(--color-gray-light);
  cursor: not-allowed;
  opacity: 0.4;
}

/* Year grid */
.dp-years {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 12px;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.dp-years::-webkit-scrollbar {
  width: 4px;
}

.dp-years::-webkit-scrollbar-thumb {
  background: var(--color-navy);
  border-radius: 4px;
}

.dp-year {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border: none;
  background: none;
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.dp-year:hover {
  background: rgba(0, 37, 64, 0.1);
}

.dp-year--selected {
  background: var(--color-navy) !important;
  color: var(--color-white) !important;
  font-weight: 700;
}

/* Month grid */
.dp-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 12px;
  gap: 6px;
}

.dp-month {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  border: none;
  background: none;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text);
  border-radius: 8px;
  cursor: pointer;
  text-transform: capitalize;
  transition: background 0.12s, color 0.12s;
}

.dp-month:hover {
  background: rgba(0, 37, 64, 0.1);
}

.dp-month--selected {
  background: var(--color-navy) !important;
  color: var(--color-white) !important;
  font-weight: 700;
}

.dp-month--disabled {
  color: var(--color-gray-light);
  cursor: not-allowed;
  opacity: 0.4;
}

.form-group .error-message {
  display: none;
  font-size: 0.7rem;
  color: var(--color-error);
  margin-top: 4px;
  padding-left: 12px;
}

.form-group input.invalid~.error-message {
  display: block;
}

.datepicker-wrapper:has(input.invalid)~.error-message {
  display: block;
}

.form-group .input-hint {
  font-size: 0.68rem;
  color: var(--color-white);
  margin-top: 3px;
  padding-left: 12px;
}

/* ---- Right Column: Legal text + Checkboxes + Button ---- */
.form-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.legal-text {
  font-size: 0.8rem;
  color: var(--color-white);
  line-height: 1.5;
  font-weight: 400;
}

.legal-text p {
  margin-bottom: 10px;
}

.legal-text p:last-child {
  margin-bottom: 0;
}

/* Checkbox items */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-group .legal-text {
  padding-left: 1.65rem;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 2px solid var(--color-white);
  border-radius: 2px;
  background: var(--color-white);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  margin-top: 2px;
}

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

.checkbox-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 5px;
  height: 8px;
  border: solid var(--color-navy-dark);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-item input[type="checkbox"].invalid {
  border-color: var(--color-error);
  box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.15);
}

.checkbox-item label {
  font-size: 0.8rem;
  color: var(--color-white);
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
}

.checkbox-item-wrapper {
  display: flex;
  flex-direction: column;
}

.checkbox-item-wrapper .error-message {
  display: none;
  font-size: 0.7rem;
  color: var(--color-error);
  margin-top: 4px;
  padding-left: 26px;
}

.checkbox-item-wrapper:has(input.invalid) .error-message {
  display: block;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 14px 32px;
  background-color: var(--color-dark);
  color: var(--color-white);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  margin-top: 8px;
}

.btn-submit:hover {
  background-color: var(--color-white);
  color: var(--color-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26, 39, 68, 0.3);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(26, 39, 68, 0.2);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Server error message */
.form-server-error {
  text-align: center;
  padding: 12px 16px;
  background: rgba(211, 47, 47, 0.06);
  border: 1px solid rgba(211, 47, 47, 0.2);
  border-radius: var(--radius-sm);
  color: var(--color-error);
  font-size: 0.8rem;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

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

  .section-form {
    padding: 30px 0 50px;
  }
}

@media (max-width: 480px) {
  .section-warning p {
    letter-spacing: 0.2em;
    font-size: 0.65rem;
  }

  .form-group input {
    font-size: 16px;
    /* Prevent zoom on iOS */
    padding: 10px 16px;
  }
}