/* TKO Apply Page Styles */

/* Visually hidden but accessible to screen readers and search engines */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Additional styles for centered form layout */
.form-container {
    min-height: calc(100vh - 300px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.form-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* ===========================
   Cognito Form Custom Styling (Chameleon Theme)
   Matches TKO Landing Page Design
   =========================== */

/* Form Container */
.cog-form {
    background-color: #1C1C1C !important;
    color: #F0F0F0 !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 18px !important;
    line-height: 1.6 !important;
}

/* Form Title */
.cog-form h2,
.cog-form .cog-page__title {
    font-family: 'Besley', serif !important;
    color: #AB8E41 !important;
    font-size: 36px !important;
    font-weight: 600 !important;
    margin-bottom: 32px !important;
    text-align: center !important;
}

/* Form Description */
.cog-form .cog-page__description {
    color: #F0F0F0 !important;
    text-align: center !important;
    margin-bottom: 32px !important;
    font-size: 18px !important;
}

/* Field Labels */
.cog-form label,
.cog-form .cog-label {
    color: #F0F0F0 !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    margin-bottom: 8px !important;
    font-family: 'Open Sans', sans-serif !important;
}

/* Required Field Indicator */
.cog-form .cog-required {
    color: #AB8E41 !important;
}

/* Input Fields */
.cog-form input[type="text"],
.cog-form input[type="email"],
.cog-form input[type="tel"],
.cog-form input[type="url"],
.cog-form input[type="number"],
.cog-form input[type="date"],
.cog-form textarea,
.cog-form select {
    background-color: #4B4B4B !important;
    border: 1px solid #7D7D7D !important;
    color: #F0F0F0 !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    border-radius: 4px !important;
    font-family: 'Open Sans', sans-serif !important;
    transition: all 0.3s ease !important;
}

/* Input Focus State */
.cog-form input[type="text"]:focus,
.cog-form input[type="email"]:focus,
.cog-form input[type="tel"]:focus,
.cog-form input[type="url"]:focus,
.cog-form input[type="number"]:focus,
.cog-form input[type="date"]:focus,
.cog-form textarea:focus,
.cog-form select:focus {
    border-color: #AB8E41 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(171, 142, 65, 0.2) !important;
}

/* Placeholder Text */
.cog-form input::placeholder,
.cog-form textarea::placeholder {
    color: #A9A9A9 !important;
    opacity: 1 !important;
}

/* Textareas */
.cog-form textarea {
    min-height: 120px !important;
    resize: vertical !important;
}

/* Select Dropdowns */
.cog-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23AB8E41' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 40px !important;
}

/* Checkboxes and Radio Buttons */
.cog-form input[type="checkbox"],
.cog-form input[type="radio"] {
    accent-color: #AB8E41 !important;
}

/* Field Groups */
.cog-form .cog-fieldset {
    background-color: transparent !important;
    border: none !important;
    margin-bottom: 24px !important;
}

/* Section Headers */
.cog-form .cog-section__title {
    font-family: 'Besley', serif !important;
    color: #AB8E41 !important;
    font-size: 24px !important;
    font-weight: 600 !important;
    margin-top: 32px !important;
    margin-bottom: 16px !important;
    border-bottom: 1px solid #4B4B4B !important;
    padding-bottom: 8px !important;
}

/* Help Text */
.cog-form .cog-help,
.cog-form .cog-hint {
    color: #A9A9A9 !important;
    font-size: 14px !important;
    margin-top: 4px !important;
}

/* Error Messages */
.cog-form .cog-error,
.cog-form .cog-error-message {
    color: #ff6b6b !important;
    font-size: 14px !important;
    margin-top: 4px !important;
}

.cog-form .cog-input--error input,
.cog-form .cog-input--error textarea,
.cog-form .cog-input--error select {
    border-color: #ff6b6b !important;
}

/* Submit Button */
.cog-form button[type="submit"],
.cog-form .cog-button--submit {
    background-color: #AB8E41 !important;
    color: #1C1C1C !important;
    padding: 18px 40px !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    font-family: 'Open Sans', sans-serif !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    min-height: 48px !important;
    margin-top: 16px !important;
}

.cog-form button[type="submit"]:hover,
.cog-form .cog-button--submit:hover {
    background-color: #C9A756 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(171, 142, 65, 0.3) !important;
}

.cog-form button[type="submit"]:focus,
.cog-form .cog-button--submit:focus {
    outline: 2px solid #AB8E41 !important;
    outline-offset: 4px !important;
}

/* Secondary Buttons */
.cog-form .cog-button--secondary {
    background-color: #4B4B4B !important;
    color: #F0F0F0 !important;
    border: 1px solid #7D7D7D !important;
}

.cog-form .cog-button--secondary:hover {
    background-color: #7D7D7D !important;
    border-color: #AB8E41 !important;
}

/* Progress Bar (for multi-page forms) */
.cog-form .cog-progress {
    background-color: #4B4B4B !important;
}

.cog-form .cog-progress__bar {
    background-color: #AB8E41 !important;
}

/* File Upload */
.cog-form .cog-upload {
    background-color: #4B4B4B !important;
    border: 2px dashed #7D7D7D !important;
    border-radius: 4px !important;
    padding: 24px !important;
    transition: all 0.3s ease !important;
}

.cog-form .cog-upload:hover {
    border-color: #AB8E41 !important;
}

.cog-form .cog-upload__text {
    color: #F0F0F0 !important;
}

/* Success Message */
.cog-form .cog-success,
.cog-form .cog-success-message {
    background-color: #4B4B4B !important;
    border-left: 4px solid #AB8E41 !important;
    color: #F0F0F0 !important;
    padding: 24px !important;
    border-radius: 4px !important;
}

/* Loading Spinner */
.cog-form .cog-spinner {
    border-color: #AB8E41 !important;
}

/* Payment Fields */
.cog-form .cog-payment {
    background-color: #4B4B4B !important;
    border: 1px solid #7D7D7D !important;
    border-radius: 4px !important;
    padding: 16px !important;
}

/* Repeating Sections */
.cog-form .cog-repeater__add {
    color: #AB8E41 !important;
}

.cog-form .cog-repeater__remove {
    color: #ff6b6b !important;
}

/* Date Picker */
.cog-form .cog-datepicker {
    background-color: #4B4B4B !important;
    border: 1px solid #7D7D7D !important;
}

.cog-form .cog-datepicker__day--selected {
    background-color: #AB8E41 !important;
    color: #1C1C1C !important;
}

/* Rating Fields */
.cog-form .cog-rating__star {
    color: #AB8E41 !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .cog-form h2,
    .cog-form .cog-page__title {
        font-size: 28px !important;
    }

    .cog-form button[type="submit"],
    .cog-form .cog-button--submit {
        width: 100% !important;
        padding: 16px 32px !important;
    }
}

/* ===========================
   Multi-Step Form Styles
   =========================== */

/* Hide all fieldsets by default */
form#apply-form fieldset {
  display: none;
}

/* Show only the active step */
form#apply-form fieldset.active {
  display: block;
}

/* Ensure fieldsets don't have default browser styling */
form#apply-form fieldset {
  border: none;
  padding: 0;
  margin: 0 0 24px 0;
}

/* Radio group nested fieldset styling */
form#apply-form fieldset.radio-group {
  border: 1px solid #4B4B4B;
  padding: 16px;
  margin: 16px 0;
  border-radius: 4px;
}

/* Button disabled state - grey background like Previous button */
form#apply-form button:disabled {
  background-color: #4B4B4B;
  color: #F0F0F0;
  border: 1px solid #7D7D7D;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
  box-shadow: none;
}

form#apply-form button:disabled:hover {
  background-color: #4B4B4B;
  transform: none;
  box-shadow: none;
}

/* Form styling */
form#apply-form legend {
  font-family: 'Besley', serif;
  color: #AB8E41;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  display: block;
  width: 100%;
}

form#apply-form label {
  color: #F0F0F0;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
  display: block;
  font-family: 'Open Sans', sans-serif;
}

form#apply-form input[type="text"],
form#apply-form input[type="email"],
form#apply-form input[type="tel"],
form#apply-form input[type="url"],
form#apply-form textarea,
form#apply-form select {
  background-color: #4B4B4B;
  border: 1px solid #7D7D7D;
  color: #F0F0F0;
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 4px;
  font-family: 'Open Sans', sans-serif;
  transition: all 0.3s ease;
  width: 100%;
  margin-bottom: 16px;
}

form#apply-form input:focus,
form#apply-form textarea:focus,
form#apply-form select:focus {
  border-color: #AB8E41;
  outline: none;
  box-shadow: 0 0 0 2px rgba(171, 142, 65, 0.2);
}

form#apply-form input::placeholder,
form#apply-form textarea::placeholder {
  color: #A9A9A9;
}

/* Radio button styling - Button-like appearance */
form#apply-form .radio-button-label {
  display: block;
  width: 100%;
  background-color: #4B4B4B;
  border: 1px solid #7D7D7D;
  color: #F0F0F0;
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 4px;
  font-family: 'Open Sans', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

/* Hide the actual radio input but keep it accessible */
form#apply-form .radio-button-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Hover state for radio button labels */
form#apply-form .radio-button-label:hover {
  border-color: #AB8E41;
  background-color: #5A5A5A;
}

/* Checked state - gold background */
form#apply-form .radio-button-label:has(input[type="radio"]:checked) {
  background-color: #AB8E41;
  color: #1C1C1C;
  border-color: #AB8E41;
}

/* Checked state hover */
form#apply-form .radio-button-label:has(input[type="radio"]:checked):hover {
  background-color: #C9A756;
  border-color: #C9A756;
}

/* Focus state for keyboard navigation - accessible outline */
form#apply-form .radio-button-label:has(input[type="radio"]:focus-visible) {
  outline: 2px solid #AB8E41;
  outline-offset: 2px;
}

/* Active state - pressed effect */
form#apply-form .radio-button-label:active {
  transform: translateY(1px);
}

/* Contact Information Grid - Two columns on large screens */
form#apply-form .contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  margin-bottom: 24px;
}

/* Field wrapper to contain label and input */
form#apply-form .field-wrapper {
  display: flex;
  flex-direction: column;
}

/* Labels and inputs inside field-wrapper should not have bottom margin */
form#apply-form .field-wrapper label {
  margin-bottom: 8px;
}

form#apply-form .field-wrapper input {
  margin-bottom: 0;
}

/* Email and Phone fields should span full width (both columns) */
form#apply-form .field-wrapper:has(#email),
form#apply-form .field-wrapper:has(#phone) {
  grid-column: 1 / -1;
}

/* Responsive: Single column on mobile */
@media (max-width: 768px) {
  form#apply-form .contact-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  form#apply-form .field-wrapper input {
    margin-bottom: 16px;
  }
}

/* Button group container */
form#apply-form .button-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  clear: both;
  margin-top: 24px;
  width: 100%;
}

/* If only one button (Next on first step), align to the right */
form#apply-form .button-group:has(button:only-child) {
  justify-content: flex-end;
}

/* Remove right margin from buttons in flex layout */
form#apply-form .button-group button {
  margin-right: 0;
}

/* Button styling */
form#apply-form button {
  background-color: #AB8E41;
  color: #1C1C1C;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Open Sans', sans-serif;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 12px;
  margin-top: 0;
  min-height: 48px;
  min-width: 44px;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

/* Loading state - morph to circle */
form#apply-form button.loading {
  width: 48px;
  min-width: 48px;
  padding: 0;
  border-radius: 50%;
  cursor: not-allowed;
  pointer-events: none;
}

/* Spinner animation using ::after pseudo-element */
form#apply-form button.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  margin-left: -12px;
  border: 3px solid rgba(28, 28, 28, 0.3);
  border-top-color: #1C1C1C;
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}

/* Spinner rotation keyframes */
@keyframes spinner-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

form#apply-form button:hover:not(:disabled) {
  background-color: #C9A756;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(171, 142, 65, 0.3);
}

form#apply-form button.prev {
  background-color: #4B4B4B;
  color: #F0F0F0;
  border: 1px solid #7D7D7D;
}

form#apply-form button.prev:hover:not(:disabled) {
  background-color: #7D7D7D;
  border-color: #AB8E41;
}

/* Buttons not in button-group need top margin */
form#apply-form fieldset > button {
  margin-top: 24px;
}

/* Buttons inside button-group don't need top margin */
form#apply-form .button-group button {
  margin-top: 0;
}

/* Thank you page */
.thank-you-content {
  text-align: center;
  padding: 60px 20px;
}

.thank-you-content h1 {
  font-family: 'Besley', serif;
  color: #AB8E41;
  font-size: 42px;
  margin-bottom: 24px;
}

.thank-you-content p {
  font-size: 18px;
  color: #F0F0F0;
  margin-bottom: 16px;
  line-height: 1.6;
}

.thank-you-content a.button {
  display: inline-block;
  background-color: #AB8E41;
  color: #1C1C1C;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  margin-top: 24px;
}

.thank-you-content a.button:hover {
  background-color: #C9A756;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(171, 142, 65, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  /* Stack buttons vertically on mobile */
  form#apply-form .button-group {
    flex-direction: column-reverse;
    gap: 12px;
  }

  form#apply-form .button-group button {
    width: 100%;
    margin-bottom: 0;
  }

  /* Single button should still be full width on mobile */
  form#apply-form .button-group:has(button:only-child) {
    justify-content: stretch;
  }

  form#apply-form legend {
    font-size: 20px;
  }

  .thank-you-content h1 {
    font-size: 32px;
  }
}
