/* Калькулятор УФ-печати STM v1 */
/* DESIGN.md: --stm-blue #1565C0, --stm-orange #FF6B00, Montserrat + Inter */

.uv-calc {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  max-width: 560px;
  margin: 40px auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(21, 101, 192, 0.12);
  overflow: hidden;
}

.uv-calc-header {
  background: linear-gradient(135deg, #1565C0 0%, #1976D2 100%);
  padding: 28px 28px 24px;
  position: relative;
  overflow: hidden;
}

.uv-calc-header::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 107, 0, 0.10);
}

.uv-calc-badge {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.15em;
  font-weight: 600;
  margin-bottom: 8px;
  position: relative;
}

.uv-calc-header h3 {
  font-family: 'Montserrat', sans-serif;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  position: relative;
}

.uv-calc-header p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  margin: 6px 0 0;
  position: relative;
}

.uv-calc-body {
  padding: 24px 28px 28px;
}

.uv-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.uv-calc-field label {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #1A1A2E;
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.uv-calc-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #1A1A2E;
  background: #F8F9FA;
  text-align: center;
  -moz-appearance: textfield;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.uv-calc-field input::-webkit-outer-spin-button,
.uv-calc-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.uv-calc-field input:focus {
  outline: none;
  border-color: #1565C0;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

.uv-calc-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.uv-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #F8F9FA;
  border: 1px solid #E0E0E0;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #1A1A2E;
  user-select: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.uv-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.uv-toggle-track {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background: #CFD3D8;
  border-radius: 999px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.uv-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.22s ease;
}

.uv-toggle input:checked + .uv-toggle-track {
  background: #FF6B00;
}

.uv-toggle input:checked + .uv-toggle-track .uv-toggle-thumb {
  transform: translateX(16px);
}

.uv-toggle:hover {
  border-color: #1565C0;
}

.uv-toggle input:focus-visible + .uv-toggle-track {
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.18);
}

.uv-toggle-label {
  font-weight: 500;
}

.uv-toggle-hint {
  margin-left: 4px;
  color: #FF6B00;
  font-size: 12px;
  font-weight: 700;
}

.uv-calc-summary {
  background: #F8F9FA;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1px solid #E0E0E0;
  box-shadow: 0 4px 16px rgba(26, 26, 46, 0.04);
}

.uv-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #666;
  padding: 6px 0;
}

.uv-calc-row span:last-child {
  font-weight: 600;
  color: #1A1A2E;
}

.uv-calc-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid #E0E0E0;
}

.uv-calc-total span:first-child {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1A1A2E;
  letter-spacing: 0.02em;
}

.uv-calc-total span:last-child {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #FF6B00;
  line-height: 1;
}

.uv-calc-total span.below-min {
  color: #C62828;
}

.uv-calc-warning {
  margin-top: 14px;
  padding: 10px 14px;
  background: #FDECEA;
  border: 1px solid #F5C2BD;
  border-radius: 8px;
  color: #C62828;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.uv-calc-discount {
  margin-top: 10px;
  padding: 10px 14px;
  background: #FFF3E0;
  border: 1px solid #FFD7B0;
  border-radius: 8px;
  color: #B25300;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.uv-order-btn {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 14px 20px;
  background: #FF6B00;
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(255, 107, 0, 0.25);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.uv-order-btn:hover:not(:disabled) {
  background: #E65C00;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(255, 107, 0, 0.32);
}

.uv-order-btn:disabled {
  background: #CFD3D8;
  color: #fff;
  cursor: not-allowed;
  box-shadow: none;
}

.uv-req-link {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #1565C0;
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.2s ease;
}

.uv-req-link:hover {
  color: #FF6B00;
}

.uv-disclaimer {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #999;
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

/* ========== Модальное окно ========== */

.uv-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: 'Inter', -apple-system, sans-serif;
}

.uv-modal.is-open {
  display: flex;
  animation: uvFadeIn 0.18s ease;
}

@keyframes uvFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.uv-modal-backdrop {
  position: absolute;
  inset: 0;
}

.uv-modal-window {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
  animation: uvSlideUp 0.22s ease;
}

@keyframes uvSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.uv-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #FF5F57;
  color: rgba(0,0,0,0.55);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.18);
  transition: filter 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.uv-modal-close:hover {
  filter: brightness(0.95);
  transform: scale(1.05);
}

.uv-modal-close svg {
  display: none;
}

.uv-modal-close::before {
  content: '×';
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  line-height: 1;
}

.uv-modal-header {
  padding: 22px 26px 14px;
  border-bottom: 1px solid #F1F3F5;
}

.uv-modal-header h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0;
  letter-spacing: 0.01em;
}

.uv-modal-header p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #666;
}

.uv-modal-body {
  padding: 18px 26px 22px;
}

.uv-modal-summary {
  background: #F8F9FA;
  border: 1px solid #E0E0E0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.uv-modal-summary .uv-form-row {
  margin-bottom: 8px;
}

.uv-modal-summary .uv-form-row:last-child {
  margin-bottom: 0;
}

.uv-form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.uv-form-row label {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #1A1A2E;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.uv-form-row input[type="text"],
.uv-form-row input[type="tel"],
.uv-form-row textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: #1A1A2E;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.uv-form-row textarea {
  min-height: 76px;
  resize: vertical;
}

.uv-form-row input:focus,
.uv-form-row textarea:focus {
  outline: none;
  border-color: #1565C0;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

.uv-form-row input[readonly] {
  background: #fff;
  color: #1A1A2E;
  font-weight: 600;
  cursor: default;
}

.uv-form-required {
  color: #C62828;
  margin-left: 2px;
}

.uv-modal-form button[type="submit"] {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 13px 20px;
  background: #1565C0;
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(21, 101, 192, 0.18);
  transition: background 0.2s ease, transform 0.2s ease;
}

.uv-modal-form button[type="submit"]:hover:not(:disabled) {
  background: #1976D2;
  transform: translateY(-1px);
}

.uv-modal-form button[type="submit"]:disabled {
  background: #CFD3D8;
  cursor: not-allowed;
  box-shadow: none;
}

.uv-form-message {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
}

.uv-form-message.error {
  background: #FDECEA;
  color: #C62828;
  border: 1px solid #F5C2BD;
}

.uv-form-message.error a {
  color: #C62828;
  text-decoration: underline;
}

.uv-modal-success {
  padding: 28px 26px 30px;
  text-align: center;
}

.uv-success-icon {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 12px;
}

.uv-modal-success h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 8px;
}

.uv-modal-success p {
  font-size: 15px;
  color: #444;
  margin: 0 0 22px;
  line-height: 1.5;
}

.uv-success-close {
  padding: 11px 28px;
  background: #1565C0;
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.uv-success-close:hover {
  background: #1976D2;
}

.uv-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 540px) {
  .uv-calc {
    margin: 24px 12px;
    border-radius: 14px;
  }
  .uv-calc-header { padding: 22px 20px 18px; }
  .uv-calc-header h3 { font-size: 19px; }
  .uv-calc-body { padding: 18px 20px 22px; }
  .uv-calc-grid { grid-template-columns: 1fr; gap: 10px; }
  .uv-calc-toggles { flex-direction: column; align-items: stretch; }
  .uv-calc-toggles .uv-toggle { justify-content: flex-start; }
  .uv-calc-total span:last-child { font-size: 24px; }
  .uv-modal-header { padding: 20px 20px 12px; }
  .uv-modal-body { padding: 14px 20px 20px; }
}
