/* Shared signup form styles (used by trial.html, index.html, subjects.html) */

.form-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(74,41,112,0.12);
}

#formOverlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
#formOverlay.open { opacity: 1; pointer-events: auto; }

#formModal {
  position: fixed; z-index: 1000; background: #fff; overflow-y: auto;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.95);
  opacity: 0; pointer-events: none;
  width: min(720px, 92vw); max-height: 90vh; border-radius: 20px;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s;
}
#formModal.open { transform: translate(-50%,-50%) scale(1); opacity: 1; pointer-events: auto; }
@media (max-width: 768px) {
  #formModal { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 90vh; border-radius: 20px 20px 0 0; transform: translateY(100%); opacity: 1; }
  #formModal.open { transform: translateY(0); }
}
.form-handle { display: none; width: 42px; height: 5px; background: #ccc; border-radius: 3px; margin: 12px auto 4px; }
@media (max-width: 768px) { .form-handle { display: block; } }

.form-header {
  background: var(--purple); padding: 18px 22px 16px;
  border-radius: 20px 20px 0 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.form-title { color: var(--yellow); font-size: 20px; font-weight: 700; margin: 0; }
.form-close {
  background: none; border: none; color: #fff; font-size: 24px;
  line-height: 1; cursor: pointer; padding: 0 2px; opacity: 0.8; flex-shrink: 0;
}
.form-close:hover { opacity: 1; }

.form-body { padding: 22px 24px 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
@media (max-width: 500px) { .form-body { grid-template-columns: 1fr; } }

.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field.full { grid-column: 1 / -1; }

.form-label { font-size: 13px; font-weight: 600; color: var(--purple-dark); }
.form-label .req { color: #E24B4A; margin-inline-start: 3px; }

.form-input {
  border: 1.5px solid #D0C0E8; border-radius: 10px;
  padding: 10px 12px; font-size: 15px; font-family: inherit;
  color: #222; background: #fff; outline: none;
  transition: border-color 0.2s; width: 100%; box-sizing: border-box;
}
.form-input:focus { border-color: var(--purple); }
.form-input.invalid { border-color: #E24B4A; background: #FFF5F5; }
select.form-input {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a0dad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  padding-inline-end: 36px;
}
html:not(.ltr) select.form-input { background-position: left 12px center; }
textarea.form-input { resize: vertical; min-height: 120px; }

.input-wrap { position: relative; }
.input-icon {
  position: absolute; inset-inline-start: 12px; top: 50%;
  transform: translateY(-50%); width: 18px; height: 18px;
  color: var(--purple); pointer-events: none; z-index: 2;
}
.input-icon-top { top: 14px; transform: none; }
.form-input.has-icon { padding-inline-start: 38px; }

.form-error { font-size: 11.5px; color: #E24B4A; min-height: 15px; display: block; }

.subject-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 2px 2px; }
.subject-checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; user-select: none; color: var(--purple-dark); }
.subject-checks input[type="checkbox"] { accent-color: var(--purple); width: 16px; height: 16px; cursor: pointer; margin: 0; }
.subject-other { display: none; margin-top: 6px; }
.subject-other.show { display: block; }

.form-footer { padding: 14px 24px 24px; }
.form-submit {
  width: 100%; background: var(--purple); color: var(--yellow);
  border: none; border-radius: 26px; padding: 14px 24px;
  font-size: 17px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: opacity 0.2s;
}
.form-submit:hover { opacity: 0.87; }
.form-submit:disabled { opacity: 0.55; cursor: not-allowed; }

#formSuccess { display: none; flex-direction: column; align-items: center; justify-content: center; padding: 52px 24px; text-align: center; gap: 14px; }
#formSuccess.show { display: flex; }
.success-icon { font-size: 54px; }
.success-title { font-size: 22px; font-weight: 700; color: var(--purple-dark); }
.success-sub { font-size: 15px; color: #666; }
