/* --- CSS VARIABLES & RESET --- */
:root {
  --bg-overlay: rgba(0, 20, 26, 0.8);
  --bg-card: #001f24;
  --bg-input: #001217;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --accent-color: #00e5ff; 
  --border-color: #003840;
  
  /* Reduced radii for a tighter feel */
  --radius-card: 16px;
  --radius-input: 8px;
  --transition: all 0.3s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; }
body { background-color: #001217; }

/* --- MODAL STRUCTURE --- */
.popup-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: var(--transition);
}

.popup-backdrop {
  position: absolute; inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
}

.popup-overlay.active {
  opacity: 1; visibility: visible; pointer-events: auto;
}

.popup-container {
  position: relative;
  width: 100%;
  max-width: 420px; /* Reduced width for compactness */
  margin: 15px;
  z-index: 10000;
  transform: translateY(15px) scale(0.95);
  transition: var(--transition);
}

.popup-overlay.active .popup-container {
  transform: translateY(0) scale(1);
}

/* --- CARD STYLING & SCROLLBAR HIDING --- */
.contact-form-card {
  background: var(--bg-card);
  padding: 1.5rem; /* Reduced padding (was 2.5rem) */
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  position: relative;
  color: var(--text-primary);
  max-height: 85vh;
  overflow-y: auto;
  
  /* HIDE SCROLLBAR - Firefox */
  scrollbar-width: none;
  /* HIDE SCROLLBAR - IE and Edge */
  -ms-overflow-style: none;
}

/* HIDE SCROLLBAR - Chrome, Safari, Opera */
.contact-form-card::-webkit-scrollbar {
  display: none;
  width: 0;
}

/* --- HEADER --- */
.popup-close-btn {
  position: absolute;
  top: 1rem; right: 1rem; /* Tighter position */
  background: transparent;
  border: none;
  font-size: 1.25rem; /* Smaller icon */
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.popup-close-btn:hover { color: var(--text-primary); }

.popup-header { margin-bottom: 1.25rem; /* Reduced gap */ }

.contact-heading {
  font-size: 1.4rem; /* Smaller title */
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.text-accent { color: var(--accent-color); }

.contact-subtext {
  color: var(--text-secondary);
  font-size: 0.85rem; /* Smaller subtitle */
  line-height: 1.4;
}

/* --- FORM ELEMENTS (COMPACT) --- */
.form-group {
  margin-bottom: 0.85rem; /* Tighter gap between inputs */
}

.form-group label {
  display: block;
  margin-bottom: 0.3rem; /* Closer to input */
  font-weight: 500;
  font-size: 0.8rem; /* Smaller label */
  color: var(--text-secondary); /* Softer label color */
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group label span { color: var(--accent-color); margin-left: 2px; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem; /* Smaller padding inside input */
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-size: 0.9rem; /* Smaller input text */
  transition: var(--transition);
}

.form-group textarea {
  min-height: 80px; /* Reduced height */
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #475569;
  font-size: 0.85rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.1);
}

/* Custom Select Arrow Adjusted */
.form-group select {
  background-position: right 0.8rem center;
  background-size: 1rem;
}

/* --- SUBMIT BUTTON --- */
.contact-submit-btn {
  width: 100%;
  padding: 0.75rem 1.5rem; /* Smaller button */
  background-color: var(--accent-color);
  color: var(--bg-card);
  border: none;
  border-radius: 2rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
  margin-top: 0.5rem;
  letter-spacing: 0.5px;
}

.contact-submit-btn:hover {
  background-color: #00b8cc;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.5);
  transform: translateY(-1px);
}

/* Demo Button (Just for testing) */
.demo-trigger-btn {
  margin: 50px; padding: 10px 20px;
  background: var(--bg-card); color: var(--accent-color);
  border: 1px solid var(--accent-color); border-radius: 6px;
  cursor: pointer;
}