/* Calculator Rulouri Exterioare — v1.0.0
   Toate selectoarele sunt scoped sub .rulouri-calc pentru a nu conflicta cu tema WordPress. */

/* ── Reset scoped ── */
.rulouri-calc *,
.rulouri-calc *::before,
.rulouri-calc *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Widget root ── */
.rulouri-calc {
  --blue:     #0c43bd;
  --orange:   #ff6602;
  --orange-dk:#e05400;
  --text:     #12161d;
  --sub:      #4b5262;
  --muted:    #8a93a6;
  --border:   #dde1ea;
  --bg:       #fff;
  --panel:    #f5f6f9;
  --r:        6px;

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 10px;
}

/* ── Sections ── */
.rulouri-calc .sec {
  padding: 22px 28px 0;
}
.rulouri-calc .sec-contact {
  padding-bottom: 28px;
}
.rulouri-calc .sec-lbl {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sub);
  margin-bottom: 12px;
}
.rulouri-calc .sec-lbl-contact {
  margin-bottom: 14px;
}

/* ── Color swatches ── */
.rulouri-calc .swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.rulouri-calc .sw {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.rulouri-calc .sw:hover  { transform: scale(1.05); z-index: 1; }
.rulouri-calc .sw:active { transform: scale(0.93); transition: transform .08s; }
.rulouri-calc .sw.on     { border-color: #1db954; }

@media (hover: none) {
  .rulouri-calc .sw:hover { transform: none; }
}

.rulouri-calc .sw-bg {
  position: absolute;
  inset: 0;
}
.rulouri-calc .sw-shade {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 7px;
  pointer-events: none;
}
.rulouri-calc .sw-nm {
  font-size: 0.57rem;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  line-height: 1.3;
  background: rgba(255,255,255,.5);
  padding: 2px 7px;
  border-radius: 20px;
}
.rulouri-calc .sw-tick {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: #1db954;
  border: 2px solid #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: #fff;
  opacity: 0;
  transition: opacity .15s, transform .15s;
  transform: scale(0.6);
}
.rulouri-calc .sw.on .sw-tick {
  opacity: 1;
  transform: scale(1);
}
.rulouri-calc .color-chosen {
  font-weight: 700;
  color: var(--blue);
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.78rem;
}

/* ── Actionare select ── */
.rulouri-calc .fsel {
  width: 100%;
  padding: 10px 34px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 0.92rem;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a93a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color .12s;
  margin-bottom: 22px;
  font-family: inherit;
}
.rulouri-calc .fsel:focus { border-color: var(--blue); }

/* ── Dimension rows ── */
.rulouri-calc .dim-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.rulouri-calc .dim-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr 52px auto;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color .12s;
}
.rulouri-calc .dim-row:focus-within {
  border-color: var(--blue);
}
.rulouri-calc .dim-row:focus-within .dim-lbl {
  background: var(--blue);
  color: #fff;
  border-right-color: rgba(255,255,255,.18);
}
.rulouri-calc .dim-f:focus-within {
  background: #f0f4ff;
}
.rulouri-calc .dim-f:focus-within label {
  color: var(--blue);
}
.rulouri-calc .dim-f:focus-within input {
  color: var(--blue);
}
.rulouri-calc .dim-lbl {
  display: flex;
  align-items: center;
  padding: 0 13px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  font-size: 0.63rem;
  font-weight: 800;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.rulouri-calc .dim-f {
  padding: 11px 12px;
  border-right: 1px solid var(--border);
  transition: background .12s;
}
.rulouri-calc .dim-f:last-of-type { border-right: none; }
.rulouri-calc .dim-f label {
  display: block;
  font-size: 0.56rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
  transition: color .12s;
}
.rulouri-calc .dim-f input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  outline: none;
  padding: 0;
  font-family: inherit;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  transition: color .12s;
}
.rulouri-calc .dim-f input::placeholder { color: #d0d4dc; font-weight: 400; }
.rulouri-calc .dim-f input::-webkit-inner-spin-button,
.rulouri-calc .dim-f input::-webkit-outer-spin-button { -webkit-appearance: none; }

.rulouri-calc .dim-del {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0 12px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  transition: color .12s, background .12s;
}
.rulouri-calc .dim-del:hover  { color: #b00; background: #fee2e2; }
.rulouri-calc .dim-del[disabled] { opacity: 0; pointer-events: none; }

.rulouri-calc .add-btn {
  width: 100%;
  padding: 11px;
  border: 1.5px dashed var(--border);
  border-radius: var(--r);
  background: none;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.01em;
  margin-bottom: 22px;
  min-height: 44px;
  font-family: inherit;
  transition: border-color .12s, color .12s, background .12s;
}
.rulouri-calc .add-btn:hover  { border-color: var(--blue); color: var(--blue); }
.rulouri-calc .add-btn:active { border-color: var(--blue); color: var(--blue); background: #f0f4ff; }

/* ── Separator ── */
.rulouri-calc .sep {
  height: 1px;
  background: var(--border);
  margin: 22px 28px 0;
}

/* ── Trust pills ── */
.rulouri-calc .trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
}
.rulouri-calc .trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sub);
}
.rulouri-calc .trust-pill::before {
  content: '';
  display: inline-flex;
  width: 16px; height: 16px;
  flex-shrink: 0;
  background: #1db954;
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* ── Contact form ── */
.rulouri-calc .fg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 13px;
}
.rulouri-calc .ff {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rulouri-calc .ff.full { grid-column: 1 / -1; }
.rulouri-calc .ff label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sub);
}
.rulouri-calc .ff label .opt {
  font-weight: 400;
  color: var(--muted);
}
.rulouri-calc .fi {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 0.91rem;
  color: var(--text);
  background: #fff;
  outline: none;
  -webkit-appearance: none;
  transition: border-color .12s;
  width: 100%;
  font-family: inherit;
}
.rulouri-calc .fi:focus     { border-color: var(--blue); }
.rulouri-calc .fi::placeholder { color: #c5cad4; }
.rulouri-calc textarea.fi   { resize: vertical; }

/* ── Buttons ── */
.rulouri-calc .btn-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-size: 1.08rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.01em;
  margin-bottom: 9px;
  font-family: inherit;
  transition: background .13s, transform .1s, opacity .13s;
}
.rulouri-calc .btn-cta:hover           { background: var(--orange-dk); }
.rulouri-calc .btn-cta:active          { transform: scale(0.97); }
.rulouri-calc .btn-cta:disabled        { opacity: 0.65; cursor: not-allowed; }

.rulouri-calc .btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 12px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.01em;
  font-family: inherit;
  transition: background .13s, transform .1s;
}
.rulouri-calc .btn-wa:hover  { background: #1eb85a; }
.rulouri-calc .btn-wa:active { transform: scale(0.97); }

/* ── GDPR ── */
.rulouri-calc .gdpr-lbl {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--sub);
  transition: border-color .12s, background .12s;
  user-select: none;
}
.rulouri-calc .gdpr-lbl:hover { border-color: var(--blue); background: #eef2ff; }
.rulouri-calc .gdpr-lbl:has(.gdpr-chk:checked) { border-color: var(--blue); background: #eef2ff; }
.rulouri-calc .gdpr-chk {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  background: #fff;
  position: relative;
  transition: background .12s, border-color .12s;
}
.rulouri-calc .gdpr-chk:checked {
  background: var(--blue);
  border-color: var(--blue);
}
.rulouri-calc .gdpr-chk:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 5px;
  width: 6px; height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* ── Validation errors ── */
.rulouri-calc .fi.err       { border-color: #dc2626 !important; }
.rulouri-calc .gdpr-lbl.err { border-color: #dc2626 !important; background: #fff5f5 !important; }

/* ── Success / sent state ── */
.rulouri-calc .sent-msg {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 15px 16px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: var(--r);
  font-size: 0.88rem;
  font-weight: 600;
  color: #15803d;
  line-height: 1.45;
  animation: rulouri-fadeUp .3s ease;
}
.rulouri-calc .sent-msg svg { flex-shrink: 0; margin-top: 1px; }

/* ── Animations ── */
@keyframes rulouri-rowIn {
  from { opacity: 0; transform: translateY(-7px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rulouri-calc .dim-row.new { animation: rulouri-rowIn .22s ease; }

@keyframes rulouri-fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Dim summary live ── */
.rulouri-calc .dim-summary {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  background: #eef2ff;
  border-radius: 20px;
  padding: 4px 12px;
  display: inline-block;
  margin-bottom: 8px;
  min-height: 0;
  transition: opacity .15s;
}
.rulouri-calc .dim-summary:empty { display: none; }

/* ── GDPR link ── */
.rulouri-calc .gdpr-lbl a {
  color: var(--blue);
  text-decoration: underline;
  font-weight: 600;
}
.rulouri-calc .gdpr-lbl a:hover { text-decoration: none; }

/* ── Hidden source input ── */
.rulouri-calc .fi-sursa { display: none; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .rulouri-calc .sec         { padding: 18px 18px 0; }
  .rulouri-calc .sec-contact { padding-bottom: 20px; }
  .rulouri-calc .sep         { margin: 18px 18px 0; }
  .rulouri-calc .swatches    { grid-template-columns: repeat(3, 1fr); }
  .rulouri-calc .fg          { grid-template-columns: 1fr; }

  /* Dim row: BUC mai mic, lățime/înălțime mai mari, padding orizontal redus */
  .rulouri-calc .dim-row     { grid-template-columns: auto 1fr 1fr 46px auto; }
  .rulouri-calc .dim-lbl     { padding: 0 10px; font-size: 0.6rem; }
  .rulouri-calc .dim-f       { padding: 9px 10px; }
  .rulouri-calc .dim-del     { min-width: 38px; padding: 0 8px; }
}
