/* === MODERN DARK FORM BASE === */
.gv-form {
    max-width: 540px;
    padding: 0.5rem;
    display: grid;
    gap: 1.35rem;
    font-family: 'Segoe UI','SF Pro Display',-apple-system,BlinkMacSystemFont,sans-serif;
    max-height: 54em!important;
}

/* === LABELS === */
.gv-form label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  gap: 0.4rem;
  color: #fff;
  letter-spacing: .01em;
  margin-bottom: 0.15rem;
}

/* === INPUTS / TEXTAREA / SELECT === */
.gv-form input,
.gv-form textarea,
.gv-form select {
  padding: 0.88rem 1.2rem;
  border: 1.5px solid #8aa2be;
  border-radius: 8px;
  color: #000000;
  font-size: 1rem;
  transition: border .23s, background .23s, box-shadow .22s;
  box-shadow: none;
}

.gv-form input::placeholder,
.gv-form textarea::placeholder {
  color: #aeb9c6;
  opacity: 1;
}

.gv-form input:hover,
.gv-form textarea:hover,
.gv-form select:hover {
  border-color: #9bb1cc;
}

.gv-form input:focus,
.gv-form textarea:focus,
.gv-form select:focus {
  outline: 2px solid #198cff;
  outline-offset: 2px;
  border-color: #198cff;
  background: #1d2129!important;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(25,140,255,.28);
}

.gv-form textarea {
  min-height: 120px;
  resize: vertical;
}

.gv-form select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa5b1' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
}

/* === INPUT ICON SLOT === */
.gv-form .input-icon { position: relative; }
.gv-form .input-icon svg {
  position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: #198cff;
  pointer-events: none; opacity: .82;
}
.gv-form input.input-with-icon { padding-left: 2.4rem; }

/* === BUTTON (MODIFIED FOR TEMPLATES) === */
.gv-form button {
  padding: 0.93rem 1.9rem;
  /* Default fallback color if no template is chosen */
  background-color: #0060ff; 
  background-image: linear-gradient(135deg, #0060ff, #0048cc 85%);
  
  color: #fff;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.07rem;
  letter-spacing: 0.03em;
  transition: all 0.23s cubic-bezier(.77,0,.175,1);
  box-shadow: 0 4px 12px rgba(0, 96, 255, 0.17);
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

/* Detects if a style attribute is present (from your builder) and removes the default gradient */
.gv-form button[style*="background"] {
    background-image: none; 
}

.gv-form button:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.1); /* Glows whatever color is currently set */
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.gv-form button:active {
  transform: translateY(0) scale(0.98);
}
.gv-form button:disabled { opacity: 0.7; cursor: wait; }

/* === LOADING STATE === */
.gv-form button.loading { color: transparent !important; }
.gv-form button.loading::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  top: 50%; left: 50%;
  margin: -10px 0 0 -10px;
  border: 3px solid rgba(255,255,255,0.23);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.85s linear infinite;
  filter: blur(0.3px);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === STATUS MESSAGES === */
/* === UPDATED STATUS MESSAGES === */
.gv-resp {
    border-radius: 8px;
    text-align: center;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(.77, 0, .175, 1);
    background: transparent;
    border: none;
    
    /* ADD THESE LINES: */
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    overflow: hidden; /* Prevents text bleeding out while hidden */
}

.gv-resp.success, .gv-resp.error { 
    opacity: 1; 
    pointer-events: auto; 
    max-height: 100px; /* Allow it to grow to its natural height */
    margin-top: 1.5rem; 
    padding: 1.12rem 1rem; 
}
.gv-resp.success {
  background: linear-gradient(90deg,#0f5132 0,#1b8135 100%);
  border: 1.2px solid #198754;
  color: #eafbe8;
  box-shadow: 0 0 10px #1b813544;
}
.gv-resp.error {
  background: linear-gradient(90deg,#661010 0,#912020 100%);
  border: 1.2px solid #e53e3e;
  color: #fff;
  box-shadow: 0 0 10px #91202044;
}

/* === CHECKBOX === */
.gv-form .checkbox-container {
  display: flex;

  gap: 0.75rem;
  margin: 0.5rem 0 0.2rem 0;
}
.gv-form .checkbox-container input[type="checkbox"] {
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid #8aa2be;
  background: #0f1318;
  transition: border .22s, box-shadow .18s;
  position: relative;
  display: inline-block;
  vertical-align: middle;
}
.gv-form .checkbox-container input[type="checkbox"]:checked {
  background-color: #0060ff;
  background-image: linear-gradient(135deg, #0060ff 70%, #0048cc 100%);
  border-color: #0060ff;
}
.gv-form .checkbox-container input[type="checkbox"]:checked::after {
  content: '';
  display: block;
  position: absolute;
  left: 6px; top: 3px;
  width: 7px; height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  border-radius: 1.5px;
  transform: rotate(45deg) scale(1.1);
}

/* === MOBILE === */
@media (max-width: 600px) {
  .gv-form {
    padding: 1.1rem;
    gap: 0.82rem;
    border-radius: 10px;
    max-width: 98vw;
  }
  .gv-form input, .gv-form textarea, .gv-form select {
    font-size: 17px;
    padding: 0.7rem 1rem;
  }
  .gv-form button {
    padding: 0.8rem 0;
    font-size: 1.08rem;
    border-radius: 8px;
  }
  .gv-form label { font-size: 1.05rem; }
}

.gv-form input:-webkit-autofill,
.gv-form textarea:-webkit-autofill,
.gv-form select:-webkit-autofill {
  -webkit-text-fill-color:#0b1220;
  box-shadow: 0 0 0 1000px #fff inset;
  caret-color:#0b1220;
}