/* ── Castello Contact Form — Styles ──────────────────────────────────────── */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap");

/* ── Wrapper & Card ──────────────────────────────────────────────────────── */

.ccf-wrapper {
  font-family: "DM Sans", sans-serif;
  width: 100%;
}

.ccf-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  width: 100%;
}

/* ── Form Layout ─────────────────────────────────────────────────────────── */

#ccf-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Two-column row (Email + Phone) ─────────────────────────────────────── */

.ccf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .ccf-row {
    grid-template-columns: 1fr;
  }
}

/* ── Fields ──────────────────────────────────────────────────────────────── */

.ccf-field {
  display: flex;
  flex-direction: column;
}

.ccf-field input[type="text"],
.ccf-field input[type="email"],
.ccf-field input[type="tel"],
.ccf-field select,
.ccf-field textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  color: #222;
  background: #ffffff;
  border: 1.5px solid #d8d8d8;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  resize: none;
}

.ccf-field input::placeholder,
.ccf-field textarea::placeholder {
  color: #aaa;
  font-size: 14px;
}

.ccf-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
  color: #222;
}

.ccf-field select option[value=""] {
  color: #aaa;
}

.ccf-field select:invalid,
.ccf-field select option:first-child {
  color: #aaa;
}

.ccf-field input:focus,
.ccf-field textarea:focus {
  border-color: #999;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.ccf-field textarea {
  min-height: 60px;
  height: 60px;
  max-height: 60px;
}

/* ── Phone field with country picker ────────────────────────────────────── */

.ccf-phone-field {
  position: relative;
}

.ccf-phone-wrapper {
  display: flex;
  align-items: stretch;
  border: 1.5px solid #d8d8d8;
  border-radius: 6px;
  overflow: visible;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.ccf-phone-wrapper:focus-within {
  border-color: #999;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.ccf-country-select {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  cursor: pointer;
  border-right: 1.5px solid #d8d8d8;
  white-space: nowrap;
  user-select: none;
  position: relative;
  flex-shrink: 0;
}

.ccf-flag {
  font-size: 18px;
  line-height: 1;
}

.ccf-dial-code {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.ccf-arrow {
  font-size: 10px;
  color: #888;
}

.ccf-phone-wrapper input[type="tel"] {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 6px 6px 0 !important;
  flex: 1;
  min-width: 0;
}

/* ── Country Dropdown ────────────────────────────────────────────────────── */

.ccf-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: -1px;
  z-index: 9999;
  background: #fff;
  border: 1.5px solid #d8d8d8;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  width: 240px;
  max-height: 280px;
  overflow: hidden;
  flex-direction: column;
}

.ccf-dropdown.open {
  display: flex;
}

.ccf-dropdown-search {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.ccf-dropdown-search input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

#ccf-country-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  max-height: 210px;
}

#ccf-country-list li {
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  color: #333;
  transition: background 0.15s;
}

#ccf-country-list li:hover {
  background: #f5f5f5;
}

/* ── Agreement Checkbox ──────────────────────────────────────────────────── */

.ccf-checkbox-field {
  display: flex;
  align-items: flex-start;
}

.ccf-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.ccf-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 2px;
  accent-color: #555;
  cursor: pointer;
}

.ccf-checkbox-text {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

/* ── Submit Button ───────────────────────────────────────────────────────── */

.ccf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #ffffff;
  background: #c9ab6e;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  align-self: flex-start;
}

.ccf-btn:hover:not(:disabled) {
  background: #b8974f;
}

.ccf-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.ccf-btn-arrow {
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */

.ccf-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(50, 50, 50, 0.25);
  border-top-color: #333;
  border-radius: 50%;
  animation: ccf-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.ccf-btn.ccf-loading .ccf-spinner {
  display: block;
}

.ccf-btn.ccf-loading .ccf-btn-arrow {
  display: none;
}

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

/* ── Alert ───────────────────────────────────────────────────────────────── */

.ccf-alert {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 12px;
  line-height: 1.5;
}

.ccf-alert.ccf-success {
  background: #edfaf3;
  color: #1a7a4a;
  border: 1px solid #a3e6c5;
}

.ccf-alert.ccf-error {
  background: #fff2f2;
  color: #c0392b;
  border: 1px solid #f5c6c6;
}
