/**
 * Contact form modal - открывается по клику на #contact и кнопки Discuss Your Case / Contact Us
 */

.lawtheme-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lawtheme-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.lawtheme-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(46, 45, 52, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.lawtheme-modal-box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: linear-gradient(165deg, #fdfcf9 0%, #f8f5ef 100%);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(180, 160, 115, 0.2);
  padding: 32px 28px;
}

.lawtheme-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--lawyer-text-muted, #555);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.lawtheme-modal-close:hover,
.lawtheme-modal-close:focus {
  color: var(--lawyer-text, #333);
  background: rgba(197, 173, 197, 0.15);
  outline: none;
}

.lawtheme-modal-title {
  margin: 0 0 0.35em;
  font-size: var(--heading-size, clamp(26px, 3.2vw, 36px));
  font-weight: 700;
  color: var(--lawyer-text, #333);
  letter-spacing: 0.02em;
  padding-right: 36px;
}

.lawtheme-modal-sub {
  margin: 0 0 0.5em;
  font-size: var(--text-base, 16px);
  color: var(--lawyer-text-muted, #555);
  line-height: 1.5;
}

.lawtheme-modal-phone,
.lawtheme-modal-email,
.lawtheme-modal-fax {
  margin: 0 0 0.65em;
  font-size: var(--text-small, 14px);
  color: var(--lawyer-text-muted, #555);
}

.lawtheme-modal-fax {
  margin-bottom: 1.15em;
}

.lawtheme-modal-phone a,
.lawtheme-modal-email a,
.lawtheme-modal-fax a {
  color: var(--lawyer-primary-dark, #7a6a8a);
  font-weight: 600;
  text-decoration: none;
}

.lawtheme-modal-phone a:hover,
.lawtheme-modal-email a:hover,
.lawtheme-modal-fax a:hover {
  text-decoration: underline;
}

/* Form */
.lawtheme-contact-form .lawtheme-form-row {
  margin: 0 0 1em;
}

.lawtheme-contact-form label {
  display: block;
  margin-bottom: 0.35em;
  font-size: var(--text-small, 14px);
  font-weight: 600;
  color: var(--lawyer-text, #333);
}

.lawtheme-contact-form .required {
  color: var(--lawyer-primary, #C5ADC5);
}

.lawtheme-contact-form input[type="text"],
.lawtheme-contact-form input[type="email"],
.lawtheme-contact-form input[type="tel"],
.lawtheme-contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: var(--text-base, 16px);
  font-family: inherit;
  color: var(--lawyer-text, #333);
  background: #fff;
  border: 1px solid rgba(178, 181, 224, 0.35);
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.lawtheme-contact-form input::placeholder,
.lawtheme-contact-form textarea::placeholder {
  color: #999;
}

.lawtheme-contact-form input:focus,
.lawtheme-contact-form textarea:focus {
  outline: none;
  border-color: var(--lawyer-primary, #C5ADC5);
  box-shadow: 0 0 0 3px rgba(197, 173, 197, 0.2);
}

.lawtheme-contact-form textarea {
  resize: vertical;
  min-height: 80px;
}

.lawtheme-form-actions {
  margin: 1.5em 0 0;
}

.lawtheme-modal-submit {
  width: 100%;
  padding: 16px 24px;
  font-size: var(--text-small, 14px);
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background: var(--lawyer-btn-bg, #9a859e);
  color: var(--lawyer-btn-text, #fff);
  box-shadow: var(--lawyer-btn-box, 0 2px 8px rgba(154, 133, 158, 0.35));
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.lawtheme-modal-submit:hover {
  background: var(--lawyer-btn-hover, #8b7790);
  box-shadow: var(--lawyer-btn-box-hover, 0 6px 20px rgba(139, 119, 144, 0.4));
}

.lawtheme-modal-submit:active {
  transform: scale(0.98);
}

/* Success notice (after submit redirect) */
.lawtheme-contact-sent-notice {
  margin: 0 0 1em;
  padding: 14px 18px;
  background: rgba(120, 180, 120, 0.12);
  border: 1px solid rgba(100, 160, 100, 0.3);
  border-radius: 8px;
  color: #2d5a2d;
  font-size: var(--text-base, 16px);
}

.lawtheme-contact-sent-notice--global {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999998;
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
