/* ===== Scoped Alumni Registration Form Styles ===== */
.form-wrapper {
  --blue: #0073aa;
  --text: #222;
  --muted: #666;
  --border: #d9d9e0;
  --primary: #0073aa;
  --primary-dark: #005177;

  max-width: 720px;
  margin: 2.5rem auto 0;
  background: #fff;
  padding: 2.5rem 1.25rem 0;
  border-radius: 8px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);

  overflow-x: hidden;
  /* safety */
}

/* Heading */
.form-wrapper h1 {
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
  text-align: center;
  color: var(--blue);
}

/* Form */
.form-wrapper form {
  display: grid;
  margin-bottom: 0;
}

/* ===============================
   FIELDSET FIX (CRITICAL)
   =============================== */
.form-wrapper fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  min-width: 0;
  /* 🔴 CRITICAL FIX */
  max-width: 100%;
  overflow: hidden;
}

.form-wrapper legend {
  padding: 0;
  font-weight: 700;
  font-size: 1rem;
}

/* ===============================
   GRID FIX (CRITICAL)
   =============================== */
.form-wrapper .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
}

/* Grid item */
.form-wrapper .form-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* 🔴 CRITICAL FIX */
  max-width: 100%;
  margin-bottom: 0.35rem;
}

/* Labels */
.form-wrapper label {
  font-weight: 600;
  margin-bottom: 0.15rem;
  font-size: 0.82em;
}

.form-wrapper .checkbox-label {
  display: flex !important;
  align-items: flex-start !important;
  cursor: pointer;
  font-weight: 500;
}

/* ===============================
   INPUTS (SHRINK SAFE)
   =============================== */
.form-wrapper input,
.form-wrapper select,
.form-wrapper textarea {
  width: 100%;
  height: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.92rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-wrapper textarea {
  resize: vertical;
}

.form-wrapper input:focus,
.form-wrapper select:focus,
.form-wrapper textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.12);
}

.form-wrapper ::placeholder {
  color: var(--muted);
}

/* File input */
.form-wrapper input[type="file"] {
  padding: 0.4rem;
}

/* Others department input */
.form-wrapper #department_other {
  margin-top: 8px;
}

/* Checkbox alignment */
.form-wrapper input[type="checkbox"] {
  width: auto;
  margin-top: 0.25rem;
  margin-right: 10px;
}

/* Submit button */
.form-wrapper button[type="submit"] {
  width: 100%;
  padding: 0.8rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.form-wrapper button[type="submit"]:hover {
  background: var(--primary-dark);
}

.form-wrapper button[type="submit"]:active {
  transform: translateY(1px);
}

/* Messages */
.form-wrapper .success-message {
  background: #d4edda;
  color: #155724;
  padding: 12px 15px;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: 1em;
}

.form-wrapper .error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 15px;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.form-wrapper .error-message ul {
  margin: 8px 0 0 20px;
}

/* ===============================
   MOBILE — FINAL GUARANTEED FIX
   =============================== */
@media (max-width: 768px) {

  .form-wrapper {
    padding: 1.25rem 1rem;
    margin: 1rem;
  }

  .form-wrapper h1 {
    font-size: 1.35rem;
  }

  /* Force true single column */
  .form-wrapper .form-grid {
    grid-template-columns: 1fr !important;
  }

  /* Kill inline grid-column spans */
  .form-wrapper .form-group,
  .form-wrapper .form-group[style] {
    grid-column: auto !important;
  }

  .form-wrapper textarea {
    min-height: 90px;
  }
}

/* Extra small phones */
@media (max-width: 420px) {
  .form-wrapper h1 {
    font-size: 1.25rem;
  }
}

/* Scoped to the alumni thank-you page */
.alumni-thankyou-page {
  min-height: 80vh;
  background: radial-gradient(circle at top, #eaf3fb, #f8fbff);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 40px 20px;
}

/* Flex wrapper */
.alumni-thankyou-page .ty-container {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}

/* Card */
.alumni-thankyou-page .ty-card {
  width: 100%;
  max-width: 800px;
  background: #ffffff;
  border-radius: 20px;
  padding: 50px 40px;
  box-shadow:
    0 20px 50px rgba(15, 76, 117, 0.1),
    0 1px 4px rgba(0, 0, 0, 0.02);
  animation: tyFadeUp 0.6s ease-out;
}

.alumni-thankyou-page .ty-success-header {
  text-align: center;
  margin-bottom: 40px;
}

/* Icon animation */
.alumni-thankyou-page .ty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
}

.alumni-thankyou-page .ty-icon svg {
  width: 100%;
  height: 100%;
  stroke: #28a745;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  animation: tyDraw 0.8s ease forwards;
}

/* Title */
.alumni-thankyou-page .ty-title {
  font-size: 32px;
  font-weight: 800;
  color: #0f2a44;
  margin-bottom: 12px;
}

/* Message */
.alumni-thankyou-page .ty-message {
  font-size: 18px;
  color: #4a5d73;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* Payment Layout */
.alumni-thankyou-page .ty-payment-layout {
  display: flex !important;
  flex-direction: row !important;
  gap: 40px;
  background: #f8fbff;
  border: 1px solid #e1e9f1;
  border-radius: 16px;
  padding: 35px;
  margin-bottom: 30px;
  align-items: flex-start;
  text-align: left;
}

.alumni-thankyou-page .ty-payment-text {
  flex: 1;
}

.alumni-thankyou-page .ty-payment-text .ty-intro {
  font-size: 18px;
  font-weight: 600;
  color: #0f2a44;
  margin: 0 0 15px 0;
}

.alumni-thankyou-page .ty-payment-text .ty-instruction {
  margin-top: 15px;
  font-weight: 500;
}

.alumni-thankyou-page .ty-fees {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.alumni-thankyou-page .ty-fees li {
  font-size: 16px;
  color: #2c3e50;
  margin-bottom: 10px;
  padding-left: 24px;
  position: relative;
}

.alumni-thankyou-page .ty-fees li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #28a745;
  font-weight: bold;
}

.alumni-thankyou-page .ty-fees li strong {
  color: #0f4c75;
}

.alumni-thankyou-page .ty-receipt-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed #c3daed;
}

.alumni-thankyou-page .ty-contact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.alumni-thankyou-page .ty-contact-links a {
  color: #0f4c75;
  text-decoration: none;
  font-weight: 500;
}

.alumni-thankyou-page .ty-contact-links a:hover {
  text-decoration: underline;
}

/* QR Box */
.alumni-thankyou-page .ty-qr-box {
  width: 220px;
  text-align: center;
  background: #fff;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.alumni-thankyou-page .ty-qr-box img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 10px;
  border-radius: 4px;
}

.alumni-thankyou-page .ty-qr-box span {
  font-size: 12px;
  font-weight: 600;
  color: #6b7c93;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Info Box */
.alumni-thankyou-page .ty-info-box {
  background: #fff9e6;
  border-left: 4px solid #ffc107;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  text-align: left;
}

.alumni-thankyou-page .ty-info-box p {
  font-size: 15px;
  color: #5f4b0b;
  margin: 0 0 10px 0;
  line-height: 1.5;
}

.alumni-thankyou-page .ty-info-box p:last-child {
  margin-bottom: 0;
}

.alumni-thankyou-page .ty-info-box a {
  color: #856404;
  font-weight: 600;
  text-decoration: none;
}

/* Button */
.alumni-thankyou-page .ty-actions {
  text-align: center;
}

.alumni-thankyou-page .ty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 40px;
  border-radius: 12px;
  background: #0f4c75;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
}

.alumni-thankyou-page .ty-btn:hover {
  background: #1a74ad;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 76, 117, 0.2);
}

/* Animations */
@keyframes tyFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tyDraw {
  0% {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
  }

  100% {
    stroke-dasharray: 120;
    stroke-dashoffset: 0;
  }
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
  .alumni-thankyou-page .ty-card {
    padding: 40px 24px;
  }

  .alumni-thankyou-page .ty-payment-layout {
    flex-direction: column !important;
    gap: 30px;
    text-align: center;
    align-items: center;
  }

  .alumni-thankyou-page .ty-fees li {
    padding-left: 0;
  }

  .alumni-thankyou-page .ty-fees li::before {
    display: none;
  }

  .alumni-thankyou-page .ty-title {
    font-size: 26px;
  }

  .alumni-thankyou-page .ty-message {
    font-size: 16px;
  }
}