/* Shared calculator UI — sama visuaalne keel mis avaleht */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Cera Pro", "Source Sans 3", Arial, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  color: #3A2A52;
  background: #FFF8FB;
  min-height: 100vh;
  overflow-x: hidden;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 0;
}

.header {
  background: linear-gradient(135deg, #140A24, #1E1033);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.header::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.header h1 {
  font-family: "Cera Pro", "Source Sans 3", Arial, sans-serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: normal;
  margin: 0;
  padding-right: 9rem;
  color: #fff !important;
  position: relative;
  z-index: 1;
}

.header p {
  display: block;
  margin: 8px 0 0;
  padding: 0 9rem 0 0;
  max-width: 40rem;
  color: rgba(255, 255, 255, 0.82) !important;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

@media (max-width: 600px) {
  .header { padding-top: 56px; }
  .header h1,
  .header p { padding-right: 0; }
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.tb {
  padding: 10px 20px;
  border: none;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: #6E5F7A;
  font-weight: 400;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.tb.on {
  background: #fff;
  color: #1E1033;
  font-weight: 400;
  box-shadow: 0 2px 12px rgba(20, 10, 36, 0.05);
}

.card {
  background: #fff;
  border: 1px solid #F0D6E4;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(20, 10, 36, 0.05);
}

.card h2 {
  font-family: "Cera Pro", "Source Sans 3", Arial, sans-serif;
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 300;
  color: #1E1033;
  letter-spacing: normal;
}

.ch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.ch h2 { margin: 0; }

.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
}

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

label.f { display: block; }

label.f span {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #1E1033;
  margin-bottom: 8px;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #F0D6E4;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 400;
  color: #3A2A52;
  background: #fff;
  outline: 0;
  font-family: inherit;
  box-shadow: 0 2px 12px rgba(20, 10, 36, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #E8C4D6;
  box-shadow: 0 6px 20px rgba(20, 10, 36, 0.08);
}

textarea { resize: vertical; }

.res {
  background: linear-gradient(135deg, #1E1033, #140A24);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  color: #fff;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.rc {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  border-left: 3px solid rgba(255, 255, 255, 0.15);
}

.rc.a { border-left-color: #FF4696; }
.rc.b { border-left-color: #FF4696; }
.rc.s { padding: 8px 12px; }
.rc .l { font-size: 12px; opacity: 0.65; margin-bottom: 2px; font-weight: 300; }
.rc .v { font-size: 18px; font-weight: 400; letter-spacing: normal; }
.rc.b .v { font-size: 22px; color: #FF4696; }
.rc.a .v { color: #FF4696; }
.rc.s .v { font-size: 16px; }

table { width: 100%; border-collapse: collapse; }

th {
  padding: 10px 8px;
  background: #1E1033;
  color: #fff;
  font-weight: 400;
  font-size: 13px;
  text-align: center;
  border-bottom: 2px solid #140A24;
}

td { padding: 8px; border-bottom: 1px solid #F0D6E4; }
td.r { text-align: right; }
td.c { text-align: center; }

.bg,
.bb {
  padding: 8px 20px;
  background: #1E1033;
  color: #fff;
  border: 2px solid #1E1033;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.bg:hover,
.bb:hover {
  background: #FF4696 !important;
  border-color: #FF4696 !important;
  color: #1E1033;
}

.bg:disabled { opacity: 0.5; cursor: default; }

.bo {
  padding: 8px 20px;
  background: transparent;
  color: #1E1033;
  border: 2px solid #1E1033;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.bo:hover {
  background: #FF4696;
  border-color: #FF4696;
  color: #1E1033;
}

.br {
  border: none;
  background: transparent;
  color: #c0392b;
  cursor: pointer;
  font-size: 18px;
  padding: 2px;
  line-height: 1;
  font-family: inherit;
}

.pi {
  padding: 14px 16px;
  border: 1px solid #F0D6E4;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 400;
  color: #3A2A52;
  background: #fff;
  outline: 0;
  font-family: inherit;
  width: 100%;
  box-shadow: 0 2px 12px rgba(20, 10, 36, 0.05);
}

.pi:focus {
  border-color: #E8C4D6;
  box-shadow: 0 6px 20px rgba(20, 10, 36, 0.08);
}

.dt { font-size: 13px; white-space: nowrap; }
.dt th { font-size: 12px; padding: 8px 6px; }
.dt td { padding: 6px; border-bottom: 1px solid #F0D6E4; font-size: 13px; }
.dt tr.pm { background: #fef9e7; }
.dt tr.al { background: #FFF9FC; }
.dt tr.to { background: #FFF5F9; font-weight: 400; }

.hint {
  font-size: 14px;
  color: #6E5F7A;
  margin-top: 10px;
  line-height: 1.6;
}

.calc-disclaimer {
  margin: 8px 0 28px;
  font-size: 13px;
  line-height: 1.55;
  color: #6E5F7A;
}

.footer.card {
  text-align: left;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.62);
  background: #140A24;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 30px 16px 20px;
  width: 100%;
  max-width: none;
}

.footer a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.footer a:hover { color: #FF4696; text-decoration: none; }

.footer .footer-legal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 20px;
  text-align: left;
  margin: 0 auto;
  max-width: 960px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 70, 150, 0.28);
}

.footer .footer-legal-heading {
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  margin: 0 0 8px;
}

.footer .footer-legal-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.62);
  margin: 0;
}

.footer .footer-legal-text a { color: inherit; }
.footer .footer-legal-text a:hover { color: #FF4696; }

@media (max-width: 768px) {
  .footer .footer-legal {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .footer .footer-legal > div {
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .footer .footer-legal > div:first-child {
    border-top: 0;
    padding-top: 0;
  }
  .footer .footer-legal > div:last-child { padding-bottom: 0; }
}

.footer-sub {
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.62);
  background: #140A24;
  padding: 16px 16px 28px;
  margin: 0;
  width: 100%;
  max-width: none;
}

.footer-sub a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.footer-sub a:hover { color: #FF4696; }
.footer-sub .footer-bottom { margin: 0; }

.rs { font-size: 14px; color: #6E5F7A; margin-bottom: 14px; }
.rs a { color: #1E1033; }
.rn { background: #eef8ee; }
.hd { display: none !important; }
.sx { overflow-x: auto; }

.msg { padding: 10px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; }
.msg.ok { background: #e8f8e8; color: #1b5e20; }
.msg.wn { background: #fff8e1; color: #795548; }
.msg.er { background: #fdecea; color: #b71c1c; }

.sp {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

.br2 { display: flex; gap: 8px; flex-wrap: wrap; }
.excel-btn-altgr { display: none !important; }
.excel-btn-altgr.visible { display: inline-block !important; }

.upd-box {
  border: 1px solid #F0D6E4;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(20, 10, 36, 0.05);
}

.upd-box h3 {
  font-size: 15px;
  font-weight: 300;
  color: #1E1033;
  margin: 0 0 8px;
  font-family: "Cera Pro", "Source Sans 3", Arial, sans-serif;
}

.upd-box p {
  font-size: 14px;
  color: #6E5F7A;
  margin: 0 0 10px;
  line-height: 1.6;
}

.upd-box ol {
  font-size: 14px;
  color: #6E5F7A;
  margin: 0 0 12px 20px;
  line-height: 1.8;
}

.flatpickr-input { cursor: pointer !important; }

.top-actions {
  position: absolute;
  top: 12px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
}

.home-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  text-decoration: none;
}

.home-btn:hover,
.home-btn:focus {
  color: #FF4696;
  background: rgba(255, 70, 150, 0.18);
  border-color: rgba(255, 70, 150, 0.4);
}

.home-btn svg { width: 18px; height: 18px; display: block; }

.header .lang-switcher a:hover,
.header .lang-switcher a:focus,
.header .lang-switcher a.active:hover,
.header .lang-switcher a.active:focus,
.top-actions .lang-switcher a:hover,
.top-actions .lang-switcher a:focus,
.top-actions .lang-switcher a.active:hover,
.top-actions .lang-switcher a.active:focus {
  color: #FF4696 !important;
  text-decoration: none;
}

.calc-steps {
  margin-top: 16px;
  padding: 14px;
  background: #FFF5F9;
  border: 1px solid #F0D6E4;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  font-family: inherit;
  user-select: all;
  -webkit-user-select: all;
}

.calc-steps-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.calc-steps-label {
  font-size: 14px;
  font-weight: 400;
  color: #1E1033;
}

.btn-copy {
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 6px;
  border: 2px solid #1E1033;
  background: #fff;
  color: #1E1033;
  cursor: pointer;
}

.btn-copy:hover {
  background: #FF4696;
  border-color: #FF4696;
  color: #1E1033;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: none;
  padding: 0;
}

.cb-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 400;
  color: #3A2A52;
}

.cb-inline input[type="checkbox"] { width: auto; flex-shrink: 0; }
.cb-inline a { color: #1E1033; text-decoration: none; }
.cb-inline a:hover { text-decoration: underline; }
.cb-inline .nowrap { white-space: nowrap; }

.dt tr:nth-child(even) { background: #FFF9FC; }
#lastU { font-style: italic; }
#fMsg { display: none; }
#fMsg.msg { display: block; }
.upd-box .bg,
.upd-box .bo { min-height: 44px; }
.upd-box > div { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.upd-box .f { flex: 1; min-width: 130px; }

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.bo:focus-visible,
.bg:focus-visible,
.bb:focus-visible,
.btn-copy:focus-visible {
  outline: 2px solid #FF4696;
  outline-offset: 2px;
}

.calc-offline-badge {
  margin: 0 0 16px;
  padding: 8px 12px;
  font-size: 13px;
  color: #7A4A00;
  background: #FFF3D6;
  border: 1px solid #F0D090;
  border-radius: 8px;
}

@media print {
  .top-actions,
  .lang-switcher,
  .excel-btn-altgr,
  .br2,
  .upd-box,
  .footer-sub,
  .tabs,
  .calc-offline-badge,
  .calc-disclaimer { display: none !important; }
  body { background: #fff !important; color: #1E1033; }
  .header,
  .card,
  .res,
  .footer.card { box-shadow: none; break-inside: avoid; }
  .res,
  .header,
  th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .footer.card,
  .footer-sub {
    width: auto;
    max-width: none;
    margin: 0;
  }
}
