@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Unbounded:wght@200..900&display=swap');

:root {
    --heading-font: "Unbounded", sans-serif;
    --text-font: "Montserrat", system-ui;

    --black: #0B0E14;
    --mid-night: #111827;

    --button-1: #a68af9;
    --button-2: #3ABEFF;

    --cyan: #22d3ee;

    --white: #E5E7EB;
    --gray: #9CA3AF;

    --detail-text: 14px;
}

.join-section {
  display: flex;
  flex-direction: column;
  align-items: center; /* This centers the form horizontally */
  width: 100%;
  margin-top: 200px;
}

.join-section h2{
    margin-bottom: 50px;
}

.join-subtitle {
    color: var(--gray);
    margin-bottom: 60px;
}

.join-form {
  width: 100%;        /* Forces the form to take up available space */
  max-width: 700px;   /* ...but stops it at your desired max width */
  margin: 0 auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
}

.form-group label {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--gray);
}

.form-group input,
.form-group select {
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(58, 190, 255, 0.45);
    color: var(--white);
    font-size: 15px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3ABEFF;
}

.timezone-message {
    margin: 18px 0;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(58, 189, 255, 0.052);
    border: 1px solid rgba(58, 190, 255, 0.45);
    color: var(--white);
    font-size: 14px;
    display: none;
}

.form-checkbox {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 30px 0;
    font-size: 14px;
    color: var(--gray);
}

.form-checkbox input {
    margin-top: 4px;
    color: rgba(58, 190, 255, 0.45);
}

.join-btn.full {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

.form-checkbox input[type="checkbox"] {
  appearance: checkbox; 
  accent-color: var(--button-2);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ================= INFO TOOLTIP (GLOBAL) ================= */
.info-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-left: 4px;
}
  
.info-trigger i {
    font-size: 14px;
    color: var(--gray);
    transition: color 0.2s ease;
}
  
.info-trigger:hover i {
    color: #3ABEFF;
}
  
.tooltip-box {
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    padding: 12px 14px;

    background: rgba(11, 14, 20, 0.95);
    border: 1px solid rgba(166, 138, 249, 0.35);
    border-radius: 10px;

    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--gray);
    text-align: center;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;

    z-index: 20;
}
  
.tooltip-box::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(166, 138, 249, 0.35) transparent transparent transparent;
}
  
.info-trigger:hover .tooltip-box {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
}

/* ================= FORM SUCCESS STATE - NUCLEAR OPTION ================= */
/* ================= FORM SUCCESS STATE ================= */
/* Update this in your form.css */
#formSuccess {
  display: none; /* Removed !important */
  margin-top: 80px;
  text-align: center;
  width: 100%;
  position: relative;
  z-index: 9999;
}

/* This helps the section maintain its height so the page doesn't jump */
.join-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* FORCE SHOW when JS adds inline style */
#formSuccess[style*="display: block"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}
  
.success-card {
    max-width: 520px;
    margin: 0 auto;
    padding: 50px 40px;

    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(166,138,249,0.35);
    border-radius: 18px;

    animation: fadeUp 0.6s ease forwards;
}
  
.success-card i {
    font-size: 56px;
    color: #3ABEFF;
    margin-bottom: 18px;
}
  
.success-card h3 {
    font-family: var(--heading-font);
    font-size: 1.6rem;
    margin-bottom: 14px;
    color: var(--white);
}
  
.success-card p {
    font-size: 0.95rem;
    color: var(--gray);
    line-height: 1.6;
}
  
.success-sub {
    margin-top: 10px;
    font-size: 0.85rem;
    opacity: 0.85;
}
  
.success-card .join-btn {
    display: inline-block;
    margin-top: 28px;
}
  
@keyframes fadeUp {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
}

/* ================= EVENT TYPE SELECT ================= */
.event-type-selector {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 50px;
}

.event-option {
  position: relative;
  cursor: pointer;
}

.event-option input {
  display: none;
}

.event-option span {
  display: block;
  padding: 14px 28px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
  color: var(--gray);
  font-weight: 500;
  transition: all 0.25s ease;
}

.event-option input:checked + span {
  background: linear-gradient(90deg, #7c6de8, #3ABEFF);
  color: #000;
  font-weight: 600;
}

/* ================= LABEL + INFO FIX ================= */
.label-with-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 8px;
}

.form-group select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gray) 50%),
    linear-gradient(135deg, var(--gray) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 4px),
    calc(100% - 12px) calc(50% - 4px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.form-group select:hover {
  border-color: rgba(58, 190, 255, 0.45);
}

/* ================= FORM LAYOUT FIX ================= */
.form-group > label {
  display: block;
  width: 100%;
}

.label-with-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.form-group input,
.form-group select {
  width: 100%;
  margin-top: 6px;
}

.committee-group,
.form-group {
  flex-direction: column;
  align-items: stretch;
}

.info-trigger {
  display: inline-flex;
  vertical-align: middle;
}

.form-group * {
  box-sizing: border-box;
}

/* ================= CUSTOM DROPDOWN ================= */
.custom-dropdown {
  position: relative;
  width: 100%;
  margin-bottom: 7px;
}

.dropdown-selected {
  padding: 14px 18px;
  
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(58, 190, 255, 0.45);
  border-radius: 8px;
  
  cursor: pointer;
  transition: all 0.3s ease;
}

.dropdown-selected .selected-text {
  color: var(--white);
  font-size: 15px;
}

.dropdown-selected i {
  color: var(--button-2);
  font-size: 14px;
  transition: transform 0.3s ease;
}

.custom-dropdown.active .dropdown-selected i {
  transform: rotate(180deg);
}

.dropdown-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  
  background: rgba(11, 14, 20, 0.98);
  border: 1px solid rgba(58, 190, 255, 0.45);
  border-radius: 8px;
  
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  
  transition: all 0.3s ease;
  z-index: 100;
  
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.custom-dropdown.active .dropdown-options {
  max-height: 300px;
  opacity: 1;
  overflow-y: auto;
}

.dropdown-option {
  padding: 12px 18px;
  color: var(--gray);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.dropdown-option:hover {
  background: rgba(166, 138, 249, 0.15);
  color: var(--white);
  padding-left: 24px;
}

.dropdown-option.selected {
  background: rgba(166, 138, 249, 0.1);
  color: var(--cyan);
}

.dropdown-options::-webkit-scrollbar {
  width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
  background: transparent;
}

.dropdown-options::-webkit-scrollbar-thumb {
  background: rgba(166, 138, 249, 0.3);
  border-radius: 3px;
}

/* ================= INPUT WIDTH FIX ================= */
.form-group input,
.form-group .custom-dropdown,
.timezone-message {
    width: 100% !important; /* Ensures every element fills the form width */
    box-sizing: border-box; /* Prevents padding from breaking the width */
}

#timezoneMessage {
  display: none; /* Keep it hidden initially */
  width: 100%;
}

/* ================= RESPONSIVE ADJUSTMENTS ================= */

@media screen and (max-width: 768px) {
  .join-section {
      /* Reduce the massive top margin on mobile */
      margin-top: 120px; 
      padding: 0 20px; /* Add side padding so form doesn't touch screen edges */
  }

  .join-section h2 {
      font-size: 1.8rem; /* Slightly smaller heading for mobile */
      margin-bottom: 30px;
      text-align: center;
  }

  .event-type-selector {
      flex-direction: column; /* Stack MUN/Debate buttons vertically */
      gap: 12px;
      width: 100%;
      max-width: 400px;
  }

  .event-option span {
      text-align: center;
      padding: 12px 20px;
  }

  .join-form {
      max-width: 100%; /* Ensure form takes full width of its container */
  }

  .success-card {
      padding: 40px 20px; /* Less padding inside the success box on mobile */
      width: 100%;
  }

  .tooltip-box {
      /* Tooltips can break layouts on mobile; we make them wider/center-aligned */
      width: 200px;
      left: 50%;
      transform: translateX(-50%);
  }
}

@media screen and (max-width: 480px) {
  .join-section h2 {
      font-size: 1.5rem;
  }

  .form-group input, 
  .form-group select, 
  .dropdown-selected {
      font-size: 14px; /* Better readability on small phones */
      padding: 12px;
  }

  .success-card h3 {
      font-size: 1.3rem;
  }
}