/* ─── Plus Two Enquiry Form — Front-End Styles ──────────────────────────── */

:root {
  /* ── Celandine Academy brand palette ── */
  --ptwo-primary:       #2479B5;   /* shield / logo blue                  */
  --ptwo-primary-dark:  #1A5F9A;   /* hover / gradient depth              */
  --ptwo-primary-mid:   #1C6DAD;   /* mid gradient stop                   */
  --ptwo-primary-light: #EAF3FB;   /* very-light tint for bg highlights   */
  --ptwo-accent:        #F39C12;   /* lightbulb amber — use sparingly     */

  --ptwo-text:          #1e293b;
  --ptwo-muted:         #5a6e82;
  --ptwo-border:        #d4e4f0;
  --ptwo-bg:            #f4f8fc;
  --ptwo-white:         #ffffff;
  --ptwo-success:       #16a34a;
  --ptwo-success-bg:    #f0fdf4;
  --ptwo-error:         #dc2626;
  --ptwo-error-bg:      #fef2f2;
  --ptwo-radius:        12px;
  --ptwo-radius-sm:     8px;
  --ptwo-shadow:        0 4px 24px rgba(36, 121, 181, .10), 0 1px 4px rgba(0, 0, 0, .05);
  --ptwo-transition:    .2s ease;
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.ptwo-wrapper {
  padding: 24px 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ptwo-text);
  -webkit-font-smoothing: antialiased;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.ptwo-card {
  max-width: 780px;
  margin: 0 auto;
  background: var(--ptwo-white);
  border-radius: var(--ptwo-radius);
  box-shadow: var(--ptwo-shadow);
  overflow: hidden;
}

/* ── Card Header ──────────────────────────────────────────────────────────── */
.ptwo-card__header {
  /* Matches the shield gradient: shield-face blue → darker navy-blue edge */
  background: linear-gradient(150deg, #2C85C1 0%, var(--ptwo-primary) 45%, var(--ptwo-primary-dark) 100%);
  padding: 36px 40px 32px;
  text-align: center;
  color: var(--ptwo-white);
  position: relative;
  overflow: hidden;
}

.ptwo-card__header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.ptwo-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, .18);
  border-radius: 50%;
  margin-bottom: 16px;
  color: var(--ptwo-white);
  position: relative;
}

.ptwo-card__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -.4px;
  line-height: 1.2;
  position: relative;
}

.ptwo-card__subtitle {
  font-size: .95rem;
  opacity: .85;
  margin: 0;
  position: relative;
}

/* ── Response Message ─────────────────────────────────────────────────────── */
.ptwo-response {
  margin: 0;
  padding: 14px 20px 14px 16px;
  font-size: .9rem;
  font-weight: 500;
  border-left: 4px solid currentColor;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ptwo-response--success {
  background: var(--ptwo-success-bg);
  color: var(--ptwo-success);
  border-color: var(--ptwo-success);
}

.ptwo-response--error {
  background: var(--ptwo-error-bg);
  color: var(--ptwo-error);
  border-color: var(--ptwo-error);
}

/* ── Form body ────────────────────────────────────────────────────────────── */
.ptwo-form {
  padding: 36px 40px 40px;
}

/* ── Grid rows ────────────────────────────────────────────────────────────── */
.ptwo-row {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.ptwo-row--2 {
  grid-template-columns: 1fr 1fr;
}

/* ── Individual field ─────────────────────────────────────────────────────── */
.ptwo-field {
  margin-bottom: 20px;
}

.ptwo-row .ptwo-field {
  margin-bottom: 0;
}

/* ── Label ────────────────────────────────────────────────────────────────── */
.ptwo-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ptwo-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.ptwo-req {
  color: var(--ptwo-error);
  margin-left: 2px;
}

.ptwo-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: .78rem;
  color: #94a3b8;
  margin-left: 4px;
}

/* ── Text / email / tel / date inputs ─────────────────────────────────────── */
.ptwo-input-wrap {
  position: relative;
}

.ptwo-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--ptwo-border);
  border-radius: var(--ptwo-radius-sm);
  font-size: .95rem;
  color: var(--ptwo-text);
  background: var(--ptwo-white);
  outline: none;
  transition: border-color var(--ptwo-transition), box-shadow var(--ptwo-transition);
  box-sizing: border-box;
  line-height: 1.5;
}

.ptwo-input:focus {
  border-color: var(--ptwo-primary);
  box-shadow: 0 0 0 3px rgba(36, 121, 181, .15);
}

.ptwo-input:invalid:not(:placeholder-shown):not(:focus) {
  border-color: var(--ptwo-error);
}

.ptwo-input--date {
  cursor: pointer;
}

/* ── Select ───────────────────────────────────────────────────────────────── */
.ptwo-select-wrap {
  position: relative;
}

.ptwo-select {
  width: 100%;
  padding: 11px 40px 11px 14px;
  border: 1.5px solid var(--ptwo-border);
  border-radius: var(--ptwo-radius-sm);
  font-size: .95rem;
  color: var(--ptwo-text);
  background: var(--ptwo-white);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color var(--ptwo-transition), box-shadow var(--ptwo-transition);
  box-sizing: border-box;
}

.ptwo-select:focus {
  border-color: var(--ptwo-primary);
  box-shadow: 0 0 0 3px rgba(36, 121, 181, .15);
}

.ptwo-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--ptwo-muted);
}

/* ── Textarea ─────────────────────────────────────────────────────────────── */
.ptwo-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--ptwo-border);
  border-radius: var(--ptwo-radius-sm);
  font-size: .95rem;
  color: var(--ptwo-text);
  background: var(--ptwo-white);
  outline: none;
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
  line-height: 1.6;
  transition: border-color var(--ptwo-transition), box-shadow var(--ptwo-transition);
  box-sizing: border-box;
}

.ptwo-textarea:focus {
  border-color: var(--ptwo-primary);
  box-shadow: 0 0 0 3px rgba(36, 121, 181, .15);
}

/* ── Radio buttons ────────────────────────────────────────────────────────── */
.ptwo-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.ptwo-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .95rem;
  padding: 8px 16px;
  border: 1.5px solid var(--ptwo-border);
  border-radius: 50px;
  background: var(--ptwo-white);
  transition: border-color var(--ptwo-transition), background var(--ptwo-transition);
  user-select: none;
}

.ptwo-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ptwo-radio__dot {
  width: 16px;
  height: 16px;
  border: 2px solid var(--ptwo-border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: border-color var(--ptwo-transition), background var(--ptwo-transition);
  position: relative;
}

.ptwo-radio__dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--ptwo-primary);
  opacity: 0;
  transform: scale(0);
  transition: opacity .15s, transform .15s;
}

.ptwo-radio input[type="radio"]:checked ~ .ptwo-radio__dot {
  border-color: var(--ptwo-primary);
}

.ptwo-radio input[type="radio"]:checked ~ .ptwo-radio__dot::after {
  opacity: 1;
  transform: scale(1);
}

.ptwo-radio:has(input[type="radio"]:checked) {
  border-color: var(--ptwo-primary);
  background: var(--ptwo-primary-light);
  color: var(--ptwo-primary-dark);
  font-weight: 600;
}

.ptwo-radio:hover {
  border-color: var(--ptwo-primary);
}

/* ── Checkbox (consent) ───────────────────────────────────────────────────── */
.ptwo-field--consent {
  background: var(--ptwo-bg);
  border-radius: var(--ptwo-radius-sm);
  padding: 14px 16px;
  border: 1.5px solid var(--ptwo-border);
}

.ptwo-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.ptwo-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ptwo-checkbox__box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--ptwo-border);
  border-radius: 5px;
  background: var(--ptwo-white);
  margin-top: 1px;
  transition: border-color var(--ptwo-transition), background var(--ptwo-transition);
  position: relative;
}

.ptwo-checkbox__box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) scaleY(0);
  transform-origin: bottom;
  transition: transform .15s;
}

.ptwo-checkbox input[type="checkbox"]:checked ~ .ptwo-checkbox__box {
  background: var(--ptwo-primary);
  border-color: var(--ptwo-primary);
}

.ptwo-checkbox input[type="checkbox"]:checked ~ .ptwo-checkbox__box::after {
  transform: rotate(45deg) scaleY(1);
}

.ptwo-checkbox__label {
  font-size: .9rem;
  color: var(--ptwo-text);
  line-height: 1.5;
}

/* ── Submit button ────────────────────────────────────────────────────────── */
.ptwo-submit-row {
  margin-top: 28px;
  text-align: center;
}

.ptwo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 40px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ptwo-white);
  background: var(--ptwo-primary);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: background var(--ptwo-transition), transform var(--ptwo-transition), box-shadow var(--ptwo-transition);
  min-width: 200px;
  position: relative;
  letter-spacing: .02em;
  box-shadow: 0 4px 14px rgba(36, 121, 181, .40);
}

.ptwo-btn:hover:not(:disabled) {
  background: var(--ptwo-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(36, 121, 181, .45);
}

.ptwo-btn:active:not(:disabled) {
  transform: translateY(0);
}

.ptwo-btn:disabled {
  opacity: .75;
  cursor: not-allowed;
}

.ptwo-btn__spinner {
  display: none;
  animation: ptwo-spin 1s linear infinite;
  line-height: 0;
}

.ptwo-btn.ptwo-btn--loading .ptwo-btn__spinner {
  display: inline-flex;
}

.ptwo-btn.ptwo-btn--loading .ptwo-btn__text {
  opacity: .6;
}

@keyframes ptwo-spin {
  to { transform: rotate(360deg); }
}

/* ── Branding block ───────────────────────────────────────────────────────── */
.ptwo-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
  margin-bottom: 4px;
}

.ptwo-brand__logo {
  margin-bottom: 4px;
}

.ptwo-logo-img {
  max-height: 80px;
  max-width: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  /* white "halo" so logo reads on any bg colour */
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .25));
}

.ptwo-brand__name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ptwo-white);
  letter-spacing: -.3px;
  text-align: center;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.ptwo-brand__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
}

.ptwo-brand__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  color: rgba(255, 255, 255, .88);
  line-height: 1.4;
}

.ptwo-brand__meta-item svg {
  flex-shrink: 0;
  opacity: .85;
}

.ptwo-brand__divider {
  width: 60px;
  height: 2px;
  background: rgba(255, 255, 255, .3);
  border-radius: 2px;
  margin: 10px auto 4px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ptwo-card__header {
    padding: 28px 24px;
  }

  .ptwo-form {
    padding: 24px 20px 28px;
  }

  .ptwo-row--2 {
    grid-template-columns: 1fr;
  }

  .ptwo-card__title {
    font-size: 1.4rem;
  }

  .ptwo-btn {
    width: 100%;
  }

  .ptwo-brand__name {
    font-size: 1.1rem;
  }

  .ptwo-logo-img {
    max-height: 60px;
  }
}
