/* =============================================
 * CONTACT FORM COMPONENT
 * Node ID: 100-65251
 * Registration and support request form
 * Figma: https://www.figma.com/design/vOTE4XJoYfuiWuiCBCmjfj/Untitled?node-id=100-65251
 * ============================================= */

.contact-section {
  min-height: 720px;
  padding: 70px 240px;
  background-image: url('../../images/img-background-register.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: visible;
  display: flex;
  align-items: flex-start;
}

.contact-section__container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  overflow: visible;
}

/* =============================================
 * FORM CONTENT - Figma Node 100-65259
 * ============================================= */

.contact-form {
  width: 530px;
  background: #FFFFFF;
  padding: 32px 40px;
  border-radius: 16px;
  box-shadow:
    0px 4px 4px -8px rgba(0, 0, 0, 0.02),
    0px 4px 16px 10px rgba(16, 24, 40, 0.02),
    0px 2px 32px -4px rgba(16, 24, 40, 0.04);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  margin-bottom: 0;
}

.contact-form__title {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.2;
  /* 38.4px */
  color: #252525;
  text-align: center;
  margin-bottom: 0;
}

.contact-form__subtitle {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.5;
  /* 18px */
  color: #888888;
  text-align: center;
  margin-bottom: 0;
}

/* =============================================
 * FORM GROUPS - Gap spacing from Figma
 * ============================================= */

.contact-form form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.contact-form__fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

.form-group__label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-primary);
  font-weight: 510;
  /* Medium */
  font-size: 14px;
  line-height: 20px;
  color: #3D3D3D;
  margin-bottom: 0;
}

.form-group__label--required::after {
  content: '*';
  color: #FF2156;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

/* =============================================
 * FORM INPUTS - Figma spacing: gap 8px, padding 12px
 * ============================================= */

.form-input,
.form-select {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid #D1D1D1;
  border-radius: 16px;
  background: #FFFFFF;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #252525;
  transition: all 0.2s ease;
  outline: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-input::placeholder {
  color: #888888;
  opacity: 1;
}

.form-input:hover,
.form-select:hover {
  border-color: #FF8F4B;
}

.form-input:focus,
.form-select:focus {
  border-color: #FF8F4B;
  box-shadow: 0 0 0 3px rgba(255, 143, 75, 0.1);
}

.form-input--error,
.form-select--error {
  border-color: #FF2156;
}

.form-input--error:focus,
.form-select--error:focus {
  box-shadow: 0 0 0 3px rgba(255, 33, 86, 0.1);
}

/* =============================================
 * SELECT DROPDOWN (Native)
 * ============================================= */

.form-select {
  appearance: none;
  background-image: url('../../images/bab846cec38e85b041475bdf740b7550094b0657.svg');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px 20px;
  padding-right: 40px;
  cursor: pointer;
}

/* =============================================
 * CUSTOM SELECT DROPDOWN
 * ============================================= */

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select__trigger {
  width: 100%;
  min-height: 48px;
  padding: 12px 12px 12px 12px;
  border: 1px solid #D1D1D1;
  border-radius: 16px;
  background: #FFFFFF;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #252525;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-select__trigger:hover {
  border-color: #FF8F4B;
}

.custom-select__trigger:focus {
  outline: none;
  border-color: #FF8F4B;
  box-shadow: 0 0 0 3px rgba(255, 143, 75, 0.1);
}

.custom-select--open .custom-select__trigger {
  border-color: #FF8F4B;
  box-shadow: 0 0 0 3px rgba(255, 143, 75, 0.1);
}

.custom-select__value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select__value--placeholder {
  color: #888888;
}

.custom-select__arrow {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.custom-select--open .custom-select__arrow {
  transform: rotate(180deg);
}

.custom-select__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid #E7E7E7;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  max-height: 300px;
  overflow: hidden;
}

.custom-select__search {
  position: relative;
  padding: 8px;
  border-bottom: 1px solid #E7E7E7;
}

.custom-select__search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.custom-select__search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid #E7E7E7;
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 20px;
  color: #252525;
  background: #F7F7F8;
  outline: none;
  transition: all 0.2s ease;
}

.custom-select__search-input::placeholder {
  color: #888888;
}

.custom-select__search-input:focus {
  border-color: #FF8F4B;
  background: #FFFFFF;
}

.custom-select--open .custom-select__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-select__list {
  padding: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.custom-select__no-results {
  padding: 12px;
  text-align: center;
  font-family: var(--font-primary);
  font-size: 14px;
  color: #888888;
}

.custom-select__list::-webkit-scrollbar {
  width: 6px;
}

.custom-select__list::-webkit-scrollbar-track {
  background: #F7F7F8;
  border-radius: 3px;
}

.custom-select__list::-webkit-scrollbar-thumb {
  background: #D1D1D1;
  border-radius: 3px;
}

.custom-select__list::-webkit-scrollbar-thumb:hover {
  background: #B0B0B0;
}

.custom-select__option {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #3D3D3D;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-select__option:hover {
  background: #FFF5F0;
  color: #F56011;
}

.custom-select__option--selected {
  background: #FFF5F0;
  color: #F56011;
  font-weight: 510;
}

.custom-select__option--selected::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: auto;
  background: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.3337 4L6.00033 11.3333L2.66699 8' stroke='%23F56011' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
}

.custom-select__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* =============================================
 * TWO-COLUMN LAYOUT
 * ============================================= */

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

.form-row .form-group {
  margin-bottom: 0;
}

/* =============================================
 * ERROR MESSAGES
 * ============================================= */

.form-group__error {
  display: none;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 13px;
  line-height: 18px;
  color: #e53e3e;
  margin-top: 6px;
}

.form-group--error .form-group__error {
  display: block;
}

/* =============================================
 * CHECKBOX & TERMS
 * ============================================= */

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}

.form-checkbox__input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.form-checkbox__label {
  flex: 1;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.form-checkbox__label a {
  color: var(--color-primary);
  text-decoration: underline;
}

.form-checkbox__label a:hover {
  text-decoration: none;
}

/* =============================================
 * SUBMIT BUTTON - "Đăng ký ngay"
 * MATCHES header__cta styling exactly with wrapper for glow ring
 * ============================================= */

.form-submit-wrapper {
  display: inline-flex;
  border: 5px solid rgba(220, 38, 38, 0.1);
  /* Glow ring from Figma */
  border-radius: 9999px;
  padding: 0;
  width: 100%;
}

.form-submit {
  /* Layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--btn-height, 48px);
  padding: var(--btn-padding, 13px 24px);

  /* Typography */
  font-family: var(--font-primary);
  font-size: var(--btn-font-size, 16px);
  font-weight: var(--btn-font-weight, 700);
  line-height: 1;
  color: var(--color-white, #FFFFFF);
  text-align: center;
  white-space: nowrap;

  /* Visual - MATCHES header__cta exactly */
  background: linear-gradient(to bottom, #ff8f4b 0%, #ff5c00 100%);
  border: none;
  border-radius: 999px;
  /* Pill shape */

  /* Interaction */
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.form-submit:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(255, 107, 0, 0.35);
}

.form-submit:active {
  transform: scale(0.98);
}

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

.form-submit:focus {
  outline: 2px solid var(--color-primary, #ff5c00);
  outline-offset: 2px;
}

/* =============================================
 * SUCCESS MESSAGE
 * ============================================= */

.form-success {
  display: none;
  padding: 16px 20px;
  background: #48bb78;
  color: var(--color-white);
  border-radius: 8px;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  margin-bottom: 20px;
}

.form-success--visible {
  display: block;
}

/* =============================================
 * PRIVACY NOTICE
 * ============================================= */

.contact-form__privacy {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.5;
  /* 18px */
  color: #888888;
}

.contact-form__privacy a {
  font-weight: 700;
  color: #888888;
  text-decoration: none;
}

.contact-form__privacy a:hover {
  text-decoration: underline;
}

/* =============================================
 * ILLUSTRATION (Right Side)
 * ============================================= */

.contact-illustration {
  flex: 1;
  max-width: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-illustration__image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* =============================================
 * RESPONSIVE STYLES
 * ============================================= */

@media (max-width: 1440px) {
  .contact-section {
    padding: 70px 120px;
  }
}

@media (max-width: 1024px) {
  .contact-section {
    padding: 60px 60px;
  }

  .contact-section::before {
    width: 500px;
    height: 540px;
  }

  .contact-section::after {
    width: 480px;
    height: 420px;
  }

  .contact-form {
    width: 100%;
    max-width: 530px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .contact-section {
    padding: 48px 24px;
    min-height: auto;
    /* Mobile: Use bg-register-form image */
    background: url('../../themes/signature/assets/images/bg-register-form.png') center/cover no-repeat !important;
  }

  /* Override registration-bg background for mobile */
  .registration-bg {
    background: url('../../themes/signature/assets/images/bg-register-form.png') center/cover no-repeat !important;
  }

  /* Hide desktop pseudo-element backgrounds on mobile */
  .registration-bg::before,
  .registration-bg::after,
  .contact-section::before,
  .contact-section::after {
    display: none !important;
    content: none !important;
  }

  .contact-form {
    padding: 24px 24px;
  }

  .contact-form__title {
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 8px;
  }

  .contact-form__subtitle {
    font-size: 11px;
    margin-bottom: 20px;
  }

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

  .form-group {
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .contact-section {
    padding: 40px 16px;
    /* Mobile: Use bg-register-form image */
    background: url('../../themes/signature/assets/images/bg-register-form.png') center/cover no-repeat !important;
  }

  .contact-section::before,
  .contact-section::after {
    display: none !important;
    content: none !important;
  }

  .contact-form {
    padding: 20px 16px;
    width: 100%;
  }

  .contact-form__title {
    font-size: 24px;
  }

  .form-input,
  .form-select {
    height: 44px;
    font-size: 15px;
  }

  .custom-select__trigger {
    min-height: 44px;
    font-size: 15px;
  }

  .custom-select__option {
    font-size: 13px;
    padding: 8px 10px;
  }

  .form-submit-wrapper {
    border-width: 4px;
  }

  .form-submit {
    height: 44px;
    padding: 12px 24px;
    font-size: 15px;
  }
}