/* Tavara Perille Muuttolaskuri - WordPress Plugin Styles */

:root {
  --tpl-teal: #00B4A6;
  --tpl-dark: #1A2332;
  --tpl-light: #F0F9F8;
  --tpl-white: #ffffff;
  --tpl-gray: #6B7280;
  --tpl-gray-light: #F3F4F6;
  --tpl-border: #E5E7EB;
  --tpl-red: #DC2626;
}

#tpl-calculator * {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

#tpl-calculator {
  background: var(--tpl-light);
  padding: 40px 20px;
  border-radius: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.tpl-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .tpl-grid {
    grid-template-columns: 1fr;
  }
  .tpl-sidebar {
    order: -1;
  }
}

/* Stepper */
.tpl-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.tpl-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.3s;
  background: #E5E7EB;
  color: #9CA3AF;
  flex-shrink: 0;
}

.tpl-step-dot.active {
  background: var(--tpl-teal);
  color: white;
  box-shadow: 0 4px 12px rgba(0,180,166,0.3);
}

.tpl-step-dot.done {
  background: rgba(0,180,166,0.2);
  color: var(--tpl-teal);
}

.tpl-step-line {
  width: 40px;
  height: 2px;
  border-radius: 2px;
  background: #E5E7EB;
  transition: background 0.3s;
}

.tpl-step-line.done {
  background: rgba(0,180,166,0.3);
}

/* Form card */
.tpl-form-card {
  background: white;
  border-radius: 24px;
  padding: 32px;
  border: 1px solid var(--tpl-border);
}

/* Steps */
.tpl-step {
  display: none;
}

.tpl-step.active {
  display: block;
}

/* Vehicle options */
.tpl-vehicle-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 2px solid var(--tpl-border);
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  background: white;
  text-align: left;
  margin-bottom: 12px;
}

.tpl-vehicle-option:hover {
  border-color: rgba(0,180,166,0.3);
  background: #F9FAFB;
}

.tpl-vehicle-option.selected {
  border-color: var(--tpl-teal);
  background: rgba(0,180,166,0.05);
  box-shadow: 0 0 0 4px rgba(0,180,166,0.1);
}

.tpl-vehicle-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tpl-gray-light);
  font-size: 20px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.tpl-vehicle-option.selected .tpl-vehicle-icon {
  background: var(--tpl-teal);
}

.tpl-vehicle-label {
  font-weight: 700;
  color: var(--tpl-dark);
  display: block;
  font-size: 15px;
}

.tpl-vehicle-desc {
  font-size: 12px;
  color: var(--tpl-gray);
  display: block;
}

/* Men count */
.tpl-men-buttons {
  display: flex;
  gap: 8px;
}

.tpl-men-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid var(--tpl-border);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  color: var(--tpl-gray);
  font-size: 16px;
}

.tpl-men-btn.selected {
  border-color: var(--tpl-teal);
  background: var(--tpl-teal);
  color: white;
}

/* Labels */
.tpl-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tpl-gray);
  display: block;
  margin-bottom: 8px;
}

/* Range inputs */
.tpl-range-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tpl-range-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--tpl-teal);
}

.tpl-range-value {
  font-weight: 700;
  font-size: 16px;
  min-width: 60px;
  text-align: right;
  color: var(--tpl-dark);
}

/* Select */
.tpl-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--tpl-border);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: white;
  color: var(--tpl-dark);
}

.tpl-select:focus {
  border-color: var(--tpl-teal);
}

/* Input */
.tpl-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--tpl-border);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  color: var(--tpl-dark);
}

.tpl-input:focus {
  border-color: var(--tpl-teal);
}

.tpl-input.error {
  border-color: var(--tpl-red);
}

/* Textarea */
.tpl-textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--tpl-border);
  font-size: 14px;
  outline: none;
  min-height: 100px;
  resize: vertical;
  transition: border-color 0.2s;
  color: var(--tpl-dark);
}

.tpl-textarea:focus {
  border-color: var(--tpl-teal);
}

/* Checkbox label */
.tpl-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--tpl-dark);
}

.tpl-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--tpl-teal);
}

/* Toggle */
.tpl-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tpl-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.tpl-toggle {
  position: relative;
  width: 44px;
  height: 22px;
}

.tpl-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.tpl-toggle-slider {
  position: absolute;
  inset: 0;
  background: #E5E7EB;
  border-radius: 22px;
  transition: 0.3s;
}

.tpl-toggle-slider:before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.tpl-toggle input:checked + .tpl-toggle-slider {
  background: var(--tpl-teal);
}

.tpl-toggle input:checked + .tpl-toggle-slider:before {
  transform: translateX(22px);
}

/* Box section */
.tpl-box-section {
  background: rgba(0,180,166,0.05);
  border: 1px solid rgba(0,180,166,0.15);
  border-radius: 16px;
  padding: 20px;
}

.tpl-distance-section {
  background: rgba(0,180,166,0.05);
  border: 1px solid rgba(0,180,166,0.1);
  border-radius: 16px;
  padding: 16px;
}

/* Two column grid */
.tpl-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .tpl-two-col {
    grid-template-columns: 1fr;
  }
}

.tpl-space-y > * + * {
  margin-top: 16px;
}

.tpl-space-y-sm > * + * {
  margin-top: 8px;
}

/* Buttons */
.tpl-btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--tpl-teal);
  color: white;
  border: none;
  border-radius: 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tpl-btn-primary:hover {
  background: var(--tpl-dark);
}

.tpl-btn-primary:disabled {
  background: #D1D5DB;
  color: #9CA3AF;
  cursor: not-allowed;
}

.tpl-btn-secondary {
  flex: 1;
  padding: 16px;
  background: var(--tpl-gray-light);
  color: var(--tpl-gray);
  border: none;
  border-radius: 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.tpl-btn-secondary:hover {
  background: #E5E7EB;
}

.tpl-btn-row {
  display: flex;
  gap: 12px;
}

.tpl-btn-row .tpl-btn-primary {
  flex: 2;
  width: auto;
}

/* Section title */
.tpl-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tpl-gray);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.tpl-section-icon {
  color: var(--tpl-teal);
}

/* Divider */
.tpl-divider {
  border: none;
  border-top: 1px solid var(--tpl-border);
  margin: 24px 0;
}

/* Sidebar price card */
.tpl-price-card {
  background: var(--tpl-dark);
  color: white;
  border-radius: 28px;
  padding: 32px;
  position: sticky;
  top: 100px;
  overflow: hidden;
}

.tpl-price-glow-1 {
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: rgba(0,180,166,0.2);
  filter: blur(40px);
  border-radius: 50%;
}

.tpl-price-glow-2 {
  position: absolute;
  bottom: -40px; left: -40px;
  width: 120px; height: 120px;
  background: rgba(0,180,166,0.1);
  filter: blur(40px);
  border-radius: 50%;
}

.tpl-price-inner {
  position: relative;
  z-index: 1;
}

.tpl-price-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tpl-teal);
  margin-bottom: 16px;
}

.tpl-price-amount {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

.tpl-price-currency {
  font-size: 28px;
  color: var(--tpl-teal);
}

.tpl-price-vat {
  font-size: 11px;
  color: #6B7280;
  margin-top: 4px;
  margin-bottom: 24px;
}

.tpl-price-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 0 0 16px 0;
}

.tpl-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 10px;
}

.tpl-price-row-label {
  color: #9CA3AF;
}

.tpl-price-row-value {
  font-weight: 600;
}

.tpl-includes-box {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
}

.tpl-includes-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tpl-teal);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tpl-includes-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tpl-includes-list li {
  font-size: 12px;
  color: #9CA3AF;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.tpl-includes-list li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--tpl-teal);
  flex-shrink: 0;
}

.tpl-info-note {
  font-size: 10px;
  color: #6B7280;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  line-height: 1.4;
}

/* Error message */
.tpl-error-msg {
  font-size: 12px;
  color: var(--tpl-red);
  margin-top: 4px;
}

/* Success screen */
.tpl-success {
  text-align: center;
  padding: 48px 24px;
}

.tpl-success-icon {
  width: 80px;
  height: 80px;
  background: #DCFCE7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 40px;
}

.tpl-success h2 {
  font-size: 28px;
  font-weight: 900;
  color: var(--tpl-dark);
  margin-bottom: 16px;
}

.tpl-success p {
  color: var(--tpl-gray);
  margin-bottom: 12px;
  line-height: 1.6;
}

/* Blocked state */
.tpl-blocked-card {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 24px;
  padding: 24px;
}

.tpl-blocked-title {
  color: var(--tpl-red);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Additional services */
.tpl-extras-box {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
}

.tpl-extras-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tpl-extras-list li {
  font-size: 11px;
  color: #9CA3AF;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
  line-height: 1.4;
}

/* Heading */
.tpl-heading {
  font-size: 28px;
  font-weight: 900;
  color: var(--tpl-dark);
  margin-bottom: 8px;
}

.tpl-subheading {
  color: var(--tpl-gray);
  margin-bottom: 24px;
  font-size: 15px;
}

.tpl-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: tpl-spin 0.6s linear infinite;
}

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

/* ============================================================
   CHATBOT – Jenna
   ============================================================ */

/* "Kysy Jenniltä" nupp */
.tpl-btn-jenna {
  width: 100%;
  padding: 14px;
  background: white;
  color: var(--tpl-teal);
  border: 2px solid var(--tpl-teal);
  border-radius: 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}
.tpl-btn-jenna:hover {
  background: var(--tpl-teal);
  color: white;
}

/* Chat overlay */
#tpl-chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
}

@media (max-width: 600px) {
  #tpl-chat-overlay {
    padding: 0;
    align-items: flex-end;
  }
}

/* Chat aken */
#tpl-chat-window {
  width: 380px;
  max-width: 100%;
  height: 560px;
  max-height: 90vh;
  background: white;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}

@media (max-width: 600px) {
  #tpl-chat-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    align-items: flex-end !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  #tpl-chat-window {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0;
    height: 90vh;
    max-height: 90vh;
    box-sizing: border-box;
    overflow: hidden;
  }
  #tpl-chat-input-area {
    padding: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    width: 100%;
  }
  #tpl-chat-input {
    font-size: 16px !important; /* iOS zoom fix */
    min-width: 0;
    flex: 1;
  }
  #tpl-chat-send {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }
  #tpl-float-btn {
    bottom: 16px;
    right: 16px;
    font-size: 14px;
    height: 44px;
    padding: 0 16px;
  }
}

/* Header */
#tpl-chat-header {
  background: var(--tpl-dark);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#tpl-chat-avatar {
  width: 40px;
  height: 40px;
  background: var(--tpl-teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
}

#tpl-chat-name {
  font-weight: 700;
  font-size: 15px;
}

#tpl-chat-status {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

#tpl-chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
}
#tpl-chat-close:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* Sõnumid */
#tpl-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #F9FAFB;
}

.tpl-chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.tpl-chat-msg--bot {
  background: white;
  color: var(--tpl-dark);
  border: 1px solid var(--tpl-border);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.tpl-chat-msg--user {
  background: var(--tpl-teal);
  color: white;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* Trükkimise animatsioon */
.tpl-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 14px 18px;
}

.tpl-typing span {
  width: 7px;
  height: 7px;
  background: #CBD5E1;
  border-radius: 50%;
  animation: tpl-bounce 1.2s infinite;
}
.tpl-typing span:nth-child(2) { animation-delay: 0.2s; }
.tpl-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes tpl-bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* Sisend */
#tpl-chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--tpl-border);
  display: flex;
  gap: 8px;
  background: white;
}

#tpl-chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--tpl-border);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
#tpl-chat-input:focus {
  border-color: var(--tpl-teal);
}

#tpl-chat-send {
  width: 42px;
  height: 42px;
  background: var(--tpl-teal);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
#tpl-chat-send:hover {
  background: var(--tpl-dark);
}

/* Broneerimise nupud */
.tpl-chat-booking-btn-wrap,
.tpl-chat-confirm-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: flex-start;
  max-width: 85%;
}

.tpl-booking-start-btn {
  padding: 12px 20px;
  background: var(--tpl-teal);
  color: white;
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.tpl-booking-start-btn:hover {
  background: var(--tpl-dark);
}

.tpl-confirm-yes {
  padding: 12px 20px;
  background: var(--tpl-teal);
  color: white;
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.tpl-confirm-yes:hover { background: var(--tpl-dark); }

.tpl-confirm-no {
  padding: 10px 20px;
  background: white;
  color: #9CA3AF;
  border: 1px solid var(--tpl-border);
  border-radius: 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.tpl-confirm-no:hover { background: #F3F4F6; }

.tpl-offer-btn {
  padding: 12px 20px;
  background: white;
  color: var(--tpl-teal);
  border: 2px solid var(--tpl-teal);
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}
.tpl-offer-btn:hover {
  background: var(--tpl-teal);
  color: white;
}

/* ============================================================
   UJUV CHATBOT NUPP (kogu saidil)
   ============================================================ */
#tpl-float-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  height: 48px;
  padding: 0 20px;
  border-radius: 24px;
  background: var(--tpl-teal);
  color: white;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,180,166,0.4);
  z-index: 99998;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
#tpl-float-btn:hover {
  background: var(--tpl-dark);
  transform: scale(1.03);
}

/* Mobiilis peida nupu tekst, näita ainult ikoon */
@media (max-width: 600px) {
  .tpl-float-text {
    display: none;
  }
  #tpl-float-btn {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    font-size: 24px;
    justify-content: center;
  }
}

/* Pulse animatsioon float nupule */
@keyframes tpl-pulse-anim {
  0%   { box-shadow: 0 0 0 0 rgba(0,180,166,0.6); }
  70%  { box-shadow: 0 0 0 14px rgba(0,180,166,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,180,166,0); }
}
#tpl-float-btn.tpl-pulse {
  animation: tpl-pulse-anim 1.2s ease-out infinite;
}
