/* America250 Theme CSS */
/* Based on atlas theme, customized for America250 branding */

/* Primary brand color - placeholder, update with actual America250 colors */
:root {
  --america250-primary: #b67e30;
  --america250-primary-hover: #9a6a28;
  --america250-secondary: #BF0A30;
  --america250-accent: #FFD700;
  --america250-text: #1f2937;
  --america250-text-light: #4b5563;
  --america250-border: #d1d5db;
  --america250-error: #b91c1c;
  --america250-bg-light: #f4f4f5;
}

#kc-content-wrapper form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
#kc-content-wrapper form .form-group {
  margin: 0;
}
#kc-content-wrapper form div[class^=col-] {
  padding: 0;
}
#kc-content-wrapper form label.pf-c-form__label {
  color: var(--america250-text);
  font-size: 0.875rem;
}
#kc-content-wrapper form input,
#kc-content-wrapper form select,
#kc-content-wrapper form textarea {
  border: 1px solid var(--america250-border);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  color: var(--america250-text);
}
#kc-content-wrapper form input[type=text],
#kc-content-wrapper form input[type=password],
#kc-content-wrapper form input[type=email],
#kc-content-wrapper form input[type=tel],
#kc-content-wrapper form input[type=date] {
  height: 3.125rem;
}
#kc-content-wrapper form select {
  height: 3.125rem;
  background-color: white;
}
#kc-content-wrapper form input[type=checkbox] {
  height: 1.125rem;
  width: 1.125rem;
  margin-right: 0.5rem;
  accent-color: var(--america250-primary);
}
#kc-content-wrapper form .checkbox {
  margin: 0;
}
#kc-content-wrapper form .pf-c-input-group {
  position: relative;
}
#kc-content-wrapper form input[type=password] {
  z-index: 2;
  padding-inline-end: 3.125rem;
}
#kc-content-wrapper form button {
  background-color: var(--america250-primary);
  background-image: none;
  color: white;
  padding: 1rem 2rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 600;
}
#kc-content-wrapper form button:hover {
  background-color: var(--america250-primary-hover);
}
#kc-content-wrapper form button:focus {
  outline-offset: 0.125rem;
  outline: 2px solid var(--america250-primary);
}
#kc-content-wrapper form button.pf-m-control {
  background: transparent;
  border: none;
  position: absolute;
  right: 0;
  color: var(--america250-text);
  border-radius: 0;
  z-index: 4;
  padding: 1rem;
  display: flex;
  align-items: center;
}
#kc-content-wrapper form button.pf-m-control:hover {
  background: transparent;
}
#kc-content-wrapper form button.pf-m-control::after {
  display: none;
}

/* Primary submit button styling */
#kc-content-wrapper form input.pf-c-button.pf-m-primary,
#kc-content-wrapper form input#kc-register-submit {
  background-color: var(--america250-primary);
  background-image: none;
  color: white;
  padding: 1rem 2rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 600;
  border: none;
}
#kc-content-wrapper form input.pf-c-button.pf-m-primary:hover,
#kc-content-wrapper form input#kc-register-submit:hover {
  background-color: var(--america250-primary-hover);
}
#kc-content-wrapper form input.pf-c-button.pf-m-primary:focus,
#kc-content-wrapper form input#kc-register-submit:focus {
  outline-offset: 0.125rem;
  outline: 2px solid var(--america250-primary);
}
#kc-content-wrapper form input.pf-c-button.pf-m-primary:disabled,
#kc-content-wrapper form input#kc-register-submit:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

/* Error message styling */
#kc-content-wrapper form .pf-c-form__helper-text.pf-m-error,
.pf-c-alert.pf-m-inline.pf-m-danger {
  color: var(--america250-error);
  border: none;
  font-size: 1rem;
  font-weight: 400;
  margin-block-end: 1.25rem;
  font-family: Avenir, Montserrat, Corbel, "URW Gothic", source-sans-pro, sans-serif;
  line-height: 1.5;
}

/* Input field error state */
#kc-content-wrapper form input.has-error,
#kc-content-wrapper form select.has-error,
#kc-content-wrapper form input[aria-invalid="true"],
#kc-content-wrapper form select[aria-invalid="true"],
#kc-content-wrapper form .form-group.has-error input,
#kc-content-wrapper form .form-group.has-error select {
  border-color: var(--america250-error);
  background-color: #fef2f2;
}

#kc-content-wrapper form input.has-error:focus,
#kc-content-wrapper form select.has-error:focus,
#kc-content-wrapper form input[aria-invalid="true"]:focus,
#kc-content-wrapper form select[aria-invalid="true"]:focus {
  outline-color: var(--america250-error);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.2);
}

/* Inline error message */
.input-error-message,
.pf-c-form__helper-text.pf-m-error {
  display: block;
  color: var(--america250-error);
  font-size: 0.875rem;
  margin-top: 0.375rem;
  line-height: 1.4;
}
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 1rem;
}
.pf-c-alert__headingbox {
  font-weight: 600;
  display: flex;
  align-items: center;
  margin-block-end: 0.5rem;
}
.pf-c-alert__heading {
  color: #7f1d1d;
  font-size: 1.125rem;
  margin: 0;
}
.pf-c-alert__icon {
  margin: 0 0.5rem 0 0;
  color: var(--america250-error);
}
.pf-c-alert__fields {
  list-style: disc;
  padding-left: 2rem;
  margin: 0;
}
.pf-c-alert__title {
  font-weight: 400;
  color: var(--america250-error);
}
.pf-c-alert__description {
  color: var(--america250-text-light);
  margin-top: 0.5rem;
}

/* Login/register link styling */
.kc-register {
  margin-block-start: 1.5rem;
  text-align: center;
  display: block;
}

.register-button {
  display: block;
  width: 100%;
  padding: calc(1rem - 2px) 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3333333;
  text-align: center;
  text-decoration: none;
  border: 2px solid var(--america250-primary);
  border-radius: 0.375rem;
  color: var(--america250-primary);
  background-color: white;
  cursor: pointer;
  box-sizing: border-box;
}

.login-pf body .login-pf-page .card-pf a.register-button:hover {
  background-color: var(--america250-primary);
  color: white;
}

.register-button:focus {
  outline-offset: 0.125rem;
  outline: 2px solid var(--america250-primary);
}

/* Page layout */
.login-pf {
  background: none;
  height: unset;
}
.login-pf body {
  background: none;
  font-family: Avenir, Montserrat, Corbel, "URW Gothic", source-sans-pro, sans-serif;
}
.login-pf body .login-pf-page-header {
  display: none;
}
.login-pf body .login-pf-page {
  padding-bottom: 20px;
}
.login-pf body .login-pf-page .card-pf {
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 1rem 1rem;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .login-pf body .login-pf-page .card-pf {
    padding: 1.25rem 2.5rem;
    width: 40.625rem;
  }
}
.login-pf body .login-pf-page .card-pf .login-pf-header {
  margin-bottom: 1.5rem;
  text-align: center;
}
.login-pf body .login-pf-page .card-pf .login-pf-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--america250-text);
  line-height: 1.5;
  padding-block-start: 4rem;
  position: relative;
}

/* Hide the inherited CSS logo - we use the getLogo macro instead */
.login-pf body .login-pf-page .card-pf .login-pf-header h1:before {
  display: none;
}

/* Remove extra padding since we're not using CSS logo */
.login-pf body .login-pf-page .card-pf .login-pf-header h1 {
  padding-block-start: 1rem;
}

/* Logo container styling */
.logo-container {
  text-align: center;
  margin-bottom: 1.5rem;
}
.logo-container img {
  max-width: 280px;
  max-height: 180px;
  width: auto;
  height: auto;
}
@media (min-width: 768px) {
  .login-pf body .login-pf-page .card-pf .login-pf-header h1 {
    width: 29.0625rem;
    margin: 0 auto;
  }
}
.login-pf body .login-pf-page .card-pf .login-pf-page-body {
  margin-bottom: 1.5rem;
}
.login-pf body .login-pf-page .card-pf .login-pf-page-body p {
  color: var(--america250-text-light);
}
.login-pf body .login-pf-page .card-pf a {
  color: var(--america250-primary);
  text-decoration: none;
  font-weight: 600;
}
.login-pf body .login-pf-page .card-pf a:hover {
  color: #001a4d;
}

/* Conditional fields sections */
.conditional-fields {
  border-top: 1px solid var(--america250-border);
  padding-top: 1.5rem;
  margin-top: 0.5rem;
}
.conditional-fields .section-header {
  margin-bottom: 1rem;
}
.conditional-fields .section-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--america250-text);
  margin: 0 0 0.25rem 0;
}
.conditional-fields .section-header .section-description {
  font-size: 0.875rem;
  color: var(--america250-text-light);
  margin: 0;
}

/* Age block message */
#age-block-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.375rem;
  padding: 1.5rem;
  text-align: center;
}
#age-block-message .pf-c-alert__heading {
  justify-content: center;
}

/* Required field indicator - make ALL asterisks in labels red */
#kc-register-form label {
  color: var(--america250-text);
}
#kc-register-form label .required-indicator {
  color: var(--america250-error);
  margin-left: 0.25rem;
}

/* Field hints */
.field-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--america250-text-light);
  margin-bottom: 0.5rem;
  font-style: italic;
}

/* Form group spacing */
#kc-register-form .form-group {
  margin-bottom: 0;
}
#kc-register-form .form-group + .form-group {
  margin-top: 1rem;
}

/* Form Section Grouping */
.form-section {
  margin-bottom: 1.5rem;
}

.form-section-header {
  font-size: 1rem;
  font-weight: 600;
  color: var(--america250-text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--america250-border);
}

/* School Address Sub-Section */
.address-section {
  margin-top: 1rem;
}

.address-section-header {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--america250-text-light);
  margin-bottom: 0.75rem;
}

/* Address row layout for City/State/ZIP */
.address-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: baseline;
}

.address-row > .form-group {
  margin-top: 0;
}

.address-row > .city-field {
  flex: 2 1 0;
  min-width: 120px;
}

.address-row > .state-field {
  flex: 1.5 1 0;
  min-width: 140px;
}

.address-row > .zip-field {
  flex: 1 1 0;
  min-width: 100px;
}

/* Mobile: stack address fields vertically */
@media (max-width: 600px) {
  .address-row {
    flex-direction: column;
  }
  .address-row > .form-group,
  .address-row > .city-field,
  .address-row > .state-field,
  .address-row > .zip-field {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* ===========================================
   Remember Me & Form Options
   =========================================== */

.kc-form-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.remember-me-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  font-size: 0.9375rem;
  color: var(--america250-text);
  user-select: none;
}

.remember-me-label input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--america250-primary);
  cursor: pointer;
}

.remember-me-label span {
  line-height: 1;
}

#kc-form-reset-psw a {
  color: var(--america250-primary);
  font-size: 0.9375rem;
  text-decoration: none;
}

#kc-form-reset-psw a:hover {
  text-decoration: underline;
}

/* ===========================================
   Social Login / SSO Buttons
   =========================================== */

#kc-social-providers {
  display: none;
}

#kc-social-providers ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: center;
}

#kc-social-providers ul li {
  flex: 1 1 calc(33.333% - 0.5rem);
  min-width: 140px;
  max-width: 200px;
}

#kc-social-providers a.kc-social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--america250-border);
  border-radius: 0.5rem;
  background: white;
  color: var(--america250-text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

#kc-social-providers a.kc-social-button:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#kc-social-providers a.kc-social-button:focus {
  outline: 2px solid var(--america250-primary);
  outline-offset: 2px;
}

#kc-social-providers a.kc-social-button img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

#kc-social-providers a.kc-social-button span {
  white-space: nowrap;
}

/* Mobile: stack buttons vertically */
@media (max-width: 500px) {
  #kc-social-providers ul {
    flex-direction: column;
  }
  #kc-social-providers ul li {
    flex: 1 1 100%;
    max-width: none;
  }
}

/* ===========================================
   Multi-Step Registration Flow
   =========================================== */

/* Registration step containers */
.registration-step {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Age Gate Step */
#age-gate-step {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
  padding-bottom: 2rem;
}

#age-gate-step .step-header {
  margin-bottom: 1.5rem;
}

#age-gate-step .step-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--america250-text);
  margin: 0 0 0.5rem 0;
}

#age-gate-step .step-header p {
  font-size: 0.9375rem;
  color: var(--america250-text-light);
  margin: 0;
}

#age-gate-step .birthdate-field {
  margin-bottom: 1.5rem;
  text-align: left;
}

#age-gate-step .birthdate-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--america250-text);
  margin-bottom: 0.5rem;
}

#age-gate-step .birthdate-field input[type="date"] {
  width: 100%;
  height: 3.125rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--america250-border);
  border-radius: 0.375rem;
  font-size: 1rem;
  color: var(--america250-text);
}

#age-gate-step .birthdate-field .field-hint {
  margin-top: 0.375rem;
  margin-bottom: 0;
}

/* Age error message box */
#age-error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: left;
}

#age-error-message .error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.5rem;
  color: var(--america250-error);
}

#age-error-message .error-text {
  color: var(--america250-error);
  font-size: 0.9375rem;
  line-height: 1.5;
}

#age-error-message.blocked {
  background: #fef2f2;
  border-color: #f87171;
}

#age-error-message.blocked .error-text {
  font-weight: 500;
}

/* Age verification button */
#verify-age-btn {
  width: 100%;
  background-color: var(--america250-primary);
  color: white;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

#verify-age-btn:hover {
  background-color: var(--america250-primary-hover);
}

#verify-age-btn:focus {
  outline: 2px solid var(--america250-primary);
  outline-offset: 2px;
}

#verify-age-btn:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

/* Privacy Policy Step */
#privacy-policy-step {
  max-width: 500px;
  margin: 0 auto;
}

#privacy-policy-step .step-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

#privacy-policy-step .step-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--america250-text);
  margin: 0 0 0.5rem 0;
}

#privacy-policy-step .step-header p {
  font-size: 0.9375rem;
  color: var(--america250-text-light);
  margin: 0;
}

.privacy-policy-content {
  background: var(--america250-bg-light);
  border: 1px solid var(--america250-border);
  border-radius: 0.375rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.privacy-policy-content p {
  font-size: 0.9375rem;
  color: var(--america250-text);
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.privacy-policy-content p:last-child {
  margin-bottom: 0;
}

.privacy-policy-content a {
  color: var(--america250-primary);
  text-decoration: underline;
}

.privacy-policy-content a:hover {
  color: var(--america250-primary-hover);
}

/* Privacy policy links section (outside scroll area) */
.privacy-policy-links {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.privacy-policy-links p {
  font-size: 0.9375rem;
  color: var(--america250-text);
  line-height: 1.6;
  margin: 0;
}

.privacy-policy-links a {
  color: var(--america250-primary);
  text-decoration: underline;
}

.privacy-policy-links a:hover {
  color: var(--america250-primary-hover);
}

/* Bottom spacing for registration steps */
#privacy-policy-step {
  padding-bottom: 2rem;
}

#registration-form-step {
  padding-bottom: 2rem;
}

/* Privacy policy buttons */
.privacy-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.privacy-buttons button {
  flex: 1;
  max-width: 200px;
  padding: 0.875rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

#agree-privacy-btn {
  background-color: var(--america250-primary);
  color: white;
  border: none;
}

#agree-privacy-btn:hover {
  background-color: var(--america250-primary-hover);
}

#agree-privacy-btn:focus {
  outline: 2px solid var(--america250-primary);
  outline-offset: 2px;
}

#disagree-privacy-btn {
  background-color: white;
  color: var(--america250-text);
  border: 1px solid var(--america250-border);
}

#disagree-privacy-btn:hover {
  background-color: var(--america250-bg-light);
  border-color: #9ca3af;
}

#disagree-privacy-btn:focus {
  outline: 2px solid var(--america250-primary);
  outline-offset: 2px;
}

/* Registration form step */
#registration-form-step {
  animation: fadeIn 0.3s ease-in-out;
}

/* Back button styling */
.step-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--america250-text-light);
  font-size: 0.875rem;
  text-decoration: none;
  margin-bottom: 1rem;
  cursor: pointer;
}

.step-back-link:hover {
  color: var(--america250-text);
}

.step-back-link .back-arrow {
  font-size: 1rem;
}

/* Mobile responsive adjustments */
@media (max-width: 500px) {
  #age-gate-step,
  #privacy-policy-step {
    max-width: 100%;
  }

  .privacy-buttons {
    flex-direction: column;
  }

  .privacy-buttons button {
    max-width: none;
    width: 100%;
  }

  .privacy-policy-content {
    max-height: 200px;
    padding: 1rem;
  }
}
