/**
 * Standalone Modal CSS - No compilation needed
 * Contact Us Modal Styles for all pages
 */

/* CSS Variables (subset needed for modals) */
:root {
  --pc-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --pc-text: #1F1F1F;
  --pc-text-muted: #767676;
  --pc-text-light: #999999;
  --pc-text-secondary: #6B7280;
  --pc-card-bg: #FFFFFF;
  --pc-bg: #F9F9F9;
  --pc-search-bg: #F3F3F3;
  --pc-border: #E8E8E8;
  --pc-blue: #4073FF;
  --pc-blue-hover: #2C5AE0;
  --pc-blue-light: rgba(64, 115, 255, 0.05);
  --pc-red: #DC2626;
  --pc-red-bg: #FEF2F2;
  --pc-green: #10B981;
  --pc-placeholder: #C4C4C4;
  --pc-shadow-lg: 0px 10px 25px rgba(0, 0, 0, 0.15);
  --pc-radius-card: 16px;
  --pc-radius-input: 8px;
  --pc-radius-sm: 8px;
  --pc-ease: 0.2s ease;
  --pc-input-h: 48px;
  --pc-btn-h: 48px;
}

/* ===========================================
   MODAL BASE STYLES
   =========================================== */
.site-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Ensure modal uses flex display even when jQuery fadeIn sets display:block */
.site-modal[style*="display: block"],
.site-modal[style*="display:block"] {
  display: flex !important;
}

.site-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.site-modal-content {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--pc-card-bg);
  border-radius: var(--pc-radius-card);
  box-shadow: var(--pc-shadow-lg);
}

.site-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.site-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--pc-text);
  margin: 0;
}

.site-modal-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--pc-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--pc-ease);
}

.site-modal-close:hover {
  background: var(--pc-search-bg);
  color: var(--pc-text);
}

.site-modal-body {
  padding: 24px;
}

/* ===========================================
   CONTACT MODAL SPECIFIC STYLES
   =========================================== */
.contact-modal-content {
  max-width: 500px;
}

.contact-modal .site-modal-header {
  background: var(--pc-bg);
  padding: 24px;
}

.contact-modal .site-modal-title {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.6;
}

.contact-modal .site-modal-body {
  background: var(--pc-bg);
  padding: 0 24px 24px;
  border-radius: 0 0 var(--pc-radius-card) var(--pc-radius-card);
}

.contact-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-field-textarea,
.contact-field-methods {
  gap: 8px;
}

.contact-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--pc-text);
  line-height: 16px;
}

.contact-required {
  color: var(--pc-red);
  margin-left: 1px;
}

.contact-input {
  width: 100%;
  height: var(--pc-input-h);
  padding: 12px 16px;
  font-family: var(--pc-font);
  font-size: 14px;
  font-weight: 400;
  color: var(--pc-text);
  background: var(--pc-card-bg);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius-input);
  outline: none;
  transition: border-color var(--pc-ease), box-shadow var(--pc-ease);
  appearance: none;
  -webkit-appearance: none;
}

.contact-input::placeholder {
  color: var(--pc-placeholder);
}

.contact-input:focus {
  border-color: var(--pc-blue);
  box-shadow: 0 0 0 3px rgba(0, 68, 255, 0.08);
}

.contact-textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--pc-font);
  font-size: 14px;
  font-weight: 400;
  color: var(--pc-text);
  background: var(--pc-card-bg);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius-input);
  outline: none;
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
  transition: border-color var(--pc-ease), box-shadow var(--pc-ease);
}

.contact-textarea::placeholder {
  color: var(--pc-placeholder);
}

.contact-textarea:focus {
  border-color: var(--pc-blue);
  box-shadow: 0 0 0 3px rgba(0, 68, 255, 0.08);
}

.contact-methods {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px;
  background: var(--pc-search-bg);
  border-radius: var(--pc-radius-input);
}

.contact-method {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--pc-text-muted);
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

.contact-method input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.contact-method-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1px solid var(--pc-border);
  border-radius: 4px;
  background: var(--pc-card-bg);
  position: relative;
  transition: all var(--pc-ease);
}

.contact-method input[type="checkbox"]:checked + .contact-method-check {
  background: var(--pc-blue);
  border-color: var(--pc-blue);
}

.contact-method input[type="checkbox"]:checked + .contact-method-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.contact-account-opt {
  padding: 16px;
  background: var(--pc-search-bg);
  border-radius: var(--pc-radius-input);
}

.contact-account-opt .contact-method {
  align-items: flex-start;
  line-height: 1.4;
}

.contact-account-opt .contact-method-check {
  margin-top: 2px;
}

.contact-error {
  padding: 10px 14px;
  background: var(--pc-red-bg);
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: var(--pc-radius-sm);
  font-size: 13px;
}

.contact-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  padding-top: 4px;
}

.contact-btn {
  height: var(--pc-btn-h);
  padding: 0 16px;
  font-family: var(--pc-font);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.32px;
  border-radius: var(--pc-radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--pc-ease);
  white-space: nowrap;
}

.contact-btn-cancel {
  background: #EDEDED;
  color: var(--pc-text);
}

.contact-btn-cancel:hover {
  background: #E0E0E0;
}

.contact-btn-send {
  background: var(--pc-blue);
  color: #fff;
}

.contact-btn-send:hover {
  background: var(--pc-blue-hover);
}

.contact-btn-send:active {
  transform: scale(0.98);
}

/* ===========================================
   QUOTE CARD STYLES
   =========================================== */
.quote-card {
  border: 1px solid #EBEBEB;
  border-radius: 8px;
  overflow: hidden;
  height: 125px;
  position: relative;
  background: #F3F3F3;
}

.quote-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, white 0%, #4073FF 100%);
  opacity: 0.2;
  pointer-events: none;
  z-index: 2;
}

.quote-card-content {
  background: white;
  border-radius: 8px;
  margin: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.quote-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loan-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.165px;
  border-radius: 4px;
  white-space: nowrap;
}

.loan-badge-def {
  color: #2672B3;
  background: #E5F3FF;
}

.loan-badge-ym {
  color: #A64B00;
  background: #FFDEC3;
}

.quote-card-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--pc-text-secondary);
}

.quote-card-name {
  font-size: 20px;
  font-weight: 400;
  color: var(--pc-text);
  margin: 0;
  line-height: 1.6;
}

.quote-card-address {
  font-size: 14px;
  font-weight: 400;
  color: var(--pc-text-light);
  margin: 0;
}

.quote-card-pattern {
  position: absolute;
  right: -100px;
  top: 50%;
  transform: translateY(-50%);
  width: 290px;
  height: 334px;
  pointer-events: none;
}

.quote-card-pattern svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===========================================
   BUTTON LOADING/SUCCESS STATES
   =========================================== */
.pc-btn-submit {
  position: relative;
  overflow: hidden;
  transition: background 0.35s ease, box-shadow 0.3s ease;
}

.pc-btn-submit .btn-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.pc-btn-submit .btn-spinner,
.pc-btn-submit .btn-success {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pc-btn-submit .btn-text {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 1;
  transform: translateY(0);
}

.pc-btn-submit .btn-spinner {
  opacity: 0;
  transform: scale(0.5);
}

.pc-btn-submit .btn-success {
  opacity: 0;
  transform: translateY(-8px);
  gap: 6px;
}

/* Loading state */
.pc-btn-submit.is-loading .btn-text {
  opacity: 0;
  transform: translateY(8px);
}

.pc-btn-submit.is-loading .btn-spinner {
  opacity: 1;
  transform: scale(1);
}

.pc-btn-submit.is-loading {
  cursor: default;
  pointer-events: none;
}

/* Success state */
.pc-btn-submit.is-success .btn-text {
  opacity: 0;
  transform: translateY(8px);
}

.pc-btn-submit.is-success .btn-spinner {
  opacity: 0;
  transform: scale(0.5);
}

.pc-btn-submit.is-success .btn-success {
  opacity: 1;
  transform: translateY(0);
}

.pc-btn-submit.is-success {
  background: #008d00 !important;
  cursor: default;
  pointer-events: none;
}

.pc-btn-submit.is-loading:hover,
.pc-btn-submit.is-loading:active,
.pc-btn-submit.is-success:hover,
.pc-btn-submit.is-success:active {
  transform: none;
}

.pc-btn-submit .btn-spinner .spinner-ring {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pcSpin 0.6s linear infinite;
}

@keyframes pcSpin {
  to {
    transform: rotate(360deg);
  }
}

.pc-btn-submit .btn-success svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pc-btn-submit .btn-success svg polyline {
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
}

.pc-btn-submit.is-success .btn-success svg polyline {
  animation: pcDrawCheck 0.35s 0.1s ease forwards;
}

@keyframes pcDrawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

.pc-btn-submit .btn-success-label {
  font-size: inherit;
  font-weight: inherit;
  color: #fff;
  white-space: nowrap;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 640px) {
  .contact-field-row {
    grid-template-columns: 1fr;
  }

  .contact-methods {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
