/* 
    Created on : Dec 16, 2025, 2:58:09 PM
    Author     : Tark Hiir
    Description: Aiaekspert hinnapäringu vormi CSS
*/
/* ------------------------------
   GLOBAL RESETS
------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
}

/* General hidden class for any block */
.hidden {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.5s ease;
}

/* Visible state */
.show {
  max-height: 2000px; /* enough for content */
  opacity: 1;
  transition: max-height 0.5s ease, opacity 0.5s ease;
}

.space-1 hr { margin: 30px; }
.space-2 hr { margin: 30px  0; }

/* Hide elements on mobile devices */
@media (max-width: 640px) {
    .hide-on-mobile {
        display: none !important;
    }
}
/* ------------------------------
   OUTSIDE BLOCK
------------------------------ */
.outside-block { padding: 30px; margin-bottom: 30px;}
.outside-block .block-title { font-size: 1.5rem; margin-bottom: 30px; }
.outside-block .image-wrapper { position: relative; width: 300px; height: 300px; justify-self: center;}
.outside-block .image-wrapper img { width: 100%;}
.outside-block .block-wrapper { align-self: center;}

  /* Overlay common styles */
.overlay {
    position: absolute;
    transition: all 0.3s ease;
    pointer-events: none;
    background-size: cover;
    top: 0;
    left: 0;
    width: 300px;
    height: 300px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

  /* Example overlay positions */
  .overlay.overlay1 { background-image: url("../../images/sketchid/overlay_kylg_A.png"); }
  .overlay.overlay2 { background-image: url("../../images/sketchid/overlay_kylg_B.png"); }
  .overlay.overlay3 { background-image: url("../../images/sketchid/overlay_kylg_D.png"); }
  .overlay.overlay4 { background-image: url("../../images/sketchid/overlay_kylg_C.png"); }
  
/* Show overlay1 when first checkbox label is hovered */
.outside-block #esiaed:hover ~ .image-wrapper .overlay1,
.outside-block #esiaed:checked ~ .image-wrapper .overlay1 {
  opacity: 1;
  transform: scale(1.05);
}

@media (max-width: 768px) {
    .outside-block { padding: 30px 10px;}
    .outside-block .block-wrapper { margin-bottom: 30px; }
    .outside-block .block-wrapper.last { margin-bottom: 0; }
}
/* ------------------------------
   ACCORDION
------------------------------ */
.accordion { border: 0px solid #ddd; border-radius: 0px; overflow: hidden; }
.accordion-tab-wrapper { border: 1px solid var(--contrast-3); border-radius: 5px;  margin-bottom: 10px;}

/* ----- Header ----- */
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-radius: 5px;
  background: var(--base);
  transition: background 0.3s;
}
.accordion-header:hover .tab-icon,
.accordion-header:hover .tab-title,
.accordion-header:hover .tab-arrow {
  color: var(--accent-3);
}

/* ----- Tab icon and description ----- */
.tab-icon { margin-right: 8px; display:inline-flex; color: var(--accent-3); }
.tab-description { flex:1; text-align:center; color:#999; pointer-events:none; font-size: 14px; font-style: italic;}

/* ----- Title & arrow ----- */
.tab-title { margin:0; font-size:1.5rem; }
.tab-arrow { max-height: 24px; transition: transform 0.3s; }

/* ----- Accordion content ----- */
.accordion-content-container {
  display: block; /* always block, container keeps layout */
  overflow: hidden; /* ensures content doesn’t spill when collapsed */
}
.accordion-content {
/*    display: block;*/
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    background: var(--base);
    transition: max-height 0.3s ease, padding 0.2s ease, opacity 0.3s ease;
}
/* ----- Content title & subtitle ----- */
.accordion-content .block-title { font-size: 1.5rem; margin-bottom: 30px; }
.accordion-content .block-subtitle { font-size: 1.25rem; margin-bottom: 10px; }

/* ----- Open state ----- */
.accordion-tab-wrapper.active .tab-title,
.accordion-tab-wrapper.active .tab-arrow {
    color: var(--accent-3);
}
.accordion-tab-wrapper.active .accordion-header {
    border-bottom: 1px solid rgba(191,191,191,0.25);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.accordion-tab-wrapper.active .accordion-content {
  max-height: 6000px; /* enough for content */
  padding: 30px;
  visibility: visible;
  opacity: 1;
}

/* ----- Arrow rotation ----- */
.accordion-tab-wrapper.active .tab-arrow {
  transform: rotate(180deg);
}

/* Style for disabled tabs */
.accordion-tab-wrapper.disabled .accordion-header {
  opacity: 0.5;          /* make it faded */
  cursor: not-allowed;    /* show not-allowed cursor */
  pointer-events: none;   /* prevent clicks */
  background-color: #f5f5f5; /* optional lighter background */
  color: #aaa;            /* optional text color */
}

/* Optional: fade arrows/icons */
.accordion-tab-wrapper.disabled .tab-icon,
.accordion-tab-wrapper.disabled .tab-arrow,
.accordion-tab-wrapper.disabled .tab-title {
  color: #aaa;
}

@media (max-width: 768px) {
    .accordion-header {
        padding: 1rem;
    }
    .accordion-tab-wrapper.active .accordion-content {
        padding: 30px 10px;
    }
}
/* ------------------------------
   FORM GRID SYSTEM
------------------------------ */
/* Grid layout for tiles */
.form-grid {
  display: grid;
  gap: 20px;
  width: 100%;
}
/* Elements with different height */
.form-grid.start {
    align-items: start;
}
/* Column modifiers */
.full { grid-column: 1 / -1; }
.form-grid.cols-1 { grid-template-columns: minmax(300px, 600px);  justify-content: space-around;}
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

/* Mobile: single column */
@media (max-width: 768px) {
  .form-grid.cols-2,
  .form-grid.cols-3,
  .form-grid.cols-5 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .form-grid.change-on-mobile .tile-wrapper {
      margin: 0 20%;
  }
}

/* Tile wrapper */
.tile-wrapper {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 0 0 transparent;
  border: 1px solid var(--contrast-3);
  transition: box-shadow 0.3s;
}

/* Styles on hover and checked state */
.tile-wrapper:hover,
.tile-wrapper.checked {
    border-color: var(--accent-3);
    box-shadow: 0 0 5px 3px rgba(46, 204, 113, 0.25);
}

.tile-wrapper:hover .label-text,
.tile-wrapper.checked .label-text{
    color: var(--accent-3);
}
/* Slight zoom on hover */
.tile-wrapper:hover img {
  transform: scale(1.02);
}

/* Hide original checkbox */
.tile input[type="checkbox"],
.tile input[type="radio"] {
  display: none;
}

/* Tile content */
.tile {
  display: block;
  cursor: pointer;
  position: relative;
}

.tile .content img {
  width: 100%;
  display: block;
  border-radius: 5px 5px 0 0;
  transition: transform 0.3s;
}
/* Slight zoom on hover */
.tile-wrapper:hover img {
  transform: scale(1.02);
}

/* Label text */
.label-text {
  display: block;
  text-align: center;
  padding: 0.75rem 0.5rem;
}

/* Custom checkmark */
.checkmark {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.5rem;
  color: #fff;
  background: var(--accent-3);;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
/* Show checkmark when checked */
.tile-wrapper.checked .checkmark {
  opacity: 1;
}
/* Regular block styling */
.form-block {
    padding: 1.5rem;
    border: 1px solid var(--contrast-3);
    border-radius: 5px;
    background-color: #fff;
}
/* Add block animation */
.block {
  transition: max-height 0.5s ease, opacity 0.5s ease;
}
/* One column styling */
.form-column {
    padding: 2.5rem;
    border: 1px solid var(--contrast-3);
    border-radius: 5px;
    background-color: #fff;
}
@media (max-width: 768px) {
    .form-column { padding: 1rem;}
}
/* Conditional field keeps its own padding */
.conditional-field {
  transition: max-height 0.5s ease, opacity 0.5s ease;
}

/* 
 * ----- Väravad On/Off switch ----- 
 */
.block-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

/* Active content class */
.block.active-content .block-content {
  max-height: 2000px; /* adjust as needed */
  opacity: 1;
}

/* Optional: style block header and switch inline with flex */
.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 30px 30px;
}
.block-header .block-title {
    margin: 0;
}
/* On/Off tumbler */
/* Switch container */
.switch {
  position: relative;
  display: inline-block;
  width: 85px;
  height: 32px;
  margin-left: 2rem; /* align right */
}

/* Hide default checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider track */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #777;
  border-radius: 5px;
  transition: 0.4s;
}

/* Slider knob */
.slider::before {
  position: absolute;
  content: "";
  height: 33px;
  width: 42px;
  left: -3px;
  bottom: 0;
  border-radius: 5px;
  transition: 0.4s;
  background-color: #fff;
  background: linear-gradient(to bottom, #ffffff 0%, #e5e5e5 100%);
  
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  transition: transform 0.3s, background 0.3s;
  z-index: 999;
}

/* ON/OFF text inside the switch */
.labels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5px;
  font-size: 16px;
  font-weight: 500;
  color: white;
  pointer-events: none;
}

/* Specific label colors */
.labels .on { color: white; }
.labels .off { color: white; }

/* Checked state */
.switch input:checked + .slider {
  background-color: var(--accent-3);
}

.switch input:checked + .slider::before {
  transform: translateX(49px);
}

/* 
 * ---- Extra fields styling ----- 
 */
.extra-fields {
  width: 100%;
  padding: 1rem;
  box-sizing: border-box;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

/* Show extra fields when parent is checked */
.tile-wrapper.checked .extra-fields {
  max-height: 500px; /* large enough to show content */
  padding: 1rem;
}

/* Fields */
.field {
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* Regular Checkbox & Radio */
.field input[type="checkbox"],
.field input[type="radio"] {
    transform: scale(1.5);
    margin: 0 0.5rem 0 2rem;
}

/* Floating labels */
.field.floating {
  position: relative;
}

.field.floating input,
.field.floating select,
.field.floating textarea {
  width: 100%;
  padding: 0.75rem;
  height: 55px;
  border: 1px solid var(--contrast-3);
  border-radius: 0.5rem;
  background: #fff;
  font-size: 1rem;
  transition: border-color .2s, box-shadow .2s;
  cursor: pointer;
}

.field.floating input:hover,
.field.floating select:hover,
.field.floating textarea:hover {
    border-color: var(--accent-3);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-3);
  box-shadow: 0 0 5px 3px rgba(46, 204, 113, 0.25);
}

.field label {
    font-size: 1rem;
}
.field.floating label {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  transition: 0.2s;
  color: var(--contrast-2);
  pointer-events: none;
  font-size: 1rem;
}

.field.floating input:focus + label,
.field.floating input:not(:placeholder-shown) + label,
.field.floating select:focus + label,
.field.floating.select-has-value label,
.field.floating textarea:focus + label,
.field.floating textarea:not(:placeholder-shown) + label{
  top: -0.5rem;
  font-size: 0.75rem;
  background: #fff;
  padding: 0 0.25rem;
  color: var(--accent-3);
}
.field.floating input:not(:placeholder-shown) + label,
.field.floating.select-has-value label {
    color: var(--contrast-2);
}
.field-description {
    font-size: 0.75rem;
    margin: 0.5rem;
}
/* Moodulsokkel */
.moodulsokkel input[type="radio"] { display: none;}
.moodulsokkel .image-wrapper img { width: 100%; border-radius: 3px; transition: filter .3s, opacity .3s; }
.moodulsokkel .gray img { filter: grayscale(100%); opacity: 0.6; }
.btn-group { display: flex; gap: 8px; margin-top: 8px; }
.yn-btn { flex: 1; text-align: center; padding: 10px; border-radius: 5px; cursor: pointer; color: #fff; font-size: 1rem; position: relative; }
.yn-btn .check { display: none; margin-right: 4px; align-items: center; justify-content: center; }
.yn-btn .check-icon { width: 1.5rem; height: 1.5rem; stroke: #fff; stroke-width: 3; fill: none; }
label.yn-btn { display: inline-flex; justify-content: center;}
label.yes-btn { background: var(--accent-3); }
label.no-btn { background: var(--accent); }
label.yes-btn:hover .yes-btn .check { display: flex; }
label.no-btn:hover label.no-btn .check {  }

/*.btn-group input[type="radio"]:checked + label.yes-btn { background: #2271b1; color: #fff; border-color: #2271b1; }
.btn-group input[type="radio"]:checked + label.no-btn { background: #ccc; border-color: #999; color: #333; }*/
.btn-group input[type="radio"]:checked + label.yes-btn .check { display: flex; }
.btn-group input[type="radio"]:checked + label.no-btn .check { display: flex; }

/* 
 * ----- Checkbox -----
 *
 * Hide native checkbox */
.custom-checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Checkbox box */
.custom-checkbox .box {
    min-width: 24px;
    width: 24px;
    height: 24px;
    border: 1px solid var(--contrast-3); /* border color */
    display: inline-block;
    vertical-align: middle;
    margin-left: 30px;
    margin-right: 10px;
    border-radius: 3px; /* rounded corners */
    position: relative;
    transition: all 0.3s ease;
    background-color: #fff;
    box-sizing: border-box;
    cursor: pointer;
}

/* Hover effect */
.custom-checkbox:hover {
    color: var(--accent-3);
}
.custom-checkbox:hover .box {
    border-color: var(--accent-3);
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.25);
}

/* Checked state */
.custom-checkbox input:checked + .box {
    background-color: var(--accent-3);
    border-color: var(--accent-3);
}

/* Checkmark using pseudo-element */
.custom-checkbox input:checked + .box::after {
    content: "✔";
    color: white;
    font-size: 16px;
    position: absolute;
    top: -3px;
    left: 4px;
}

/* Label text */
.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

/* Optional responsive sizing 
@media (max-width: 640px) {
    .custom-checkbox .box {
        width: 20px;
        height: 20px;
    }

    .custom-checkbox input:checked + .box::after {
        font-size: 14px;
        top: -3px;
        left: 3px;
    }
}
*/
/* for textarea to be bigger */
#kliendiKommentaar {
    height: auto;
}

/* ------------------------------
    FORM BUTTONS 
------------------------------- */
.button-container {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}
.button-container.submit {
    justify-content: space-around;
}
.button-container button {
    border-radius: 5px;
}
/* Next/Previous tab button checron icon */
button.accordion-next-btn .chevron { display: inline-block; margin-left: 10px; transform: rotate(90deg);}
button.accordion-prev-btn .chevron { display: inline-block; margin-right: 10px; transform: rotate(90deg);}
/* Disabled button */
.accordion-nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none; /* prevent clicking */
}
/*-----------------------------------
    SUPPORT FORM MODAL 
---------------------------------- */
/* ========== MODAL ROOT ========== */
#contact-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

/* ========== OVERLAY ========== */
#contact-popup .modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

/* ========== MODAL BOX ========== */
#contact-popup .modal-box {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;

    margin: 7vh auto;
    border-radius: 5px;
    overflow: visible; /* IMPORTANT */
}

/* ========== CLOSE BUTTON ========== */
#contact-popup .modal-close {
    position: absolute;
    z-index: 3;
    padding: 0;
    
    top: -10px;
    right: -10px;
    
    width: 30px;
    height: 30px;
    
    font-size: 26px;
    cursor: pointer;

    background-color: #000;
    border-radius: 50%;
    line-height: 0.9;
    border: 3px solid #fff;
    
    box-shadow: 0px 1px 5px 0px rgba(0,0,0,0.7);
    
}

/* ========== SCROLL CONTAINER ========== */
#contact-popup .modal-scroll {
/*    max-height: 90vh;
    overflow-y: auto;*/
    padding: 30px;
    
    /* hide scrollbar */
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE / Edge */
}

#contact-popup .modal-scroll::-webkit-scrollbar {
    display: none;                /* Chrome / Safari */
}

/* ========== CONTENT WITH PADDING ========== */
#contact-popup .modal-content {
    padding: 0;
    max-height: 80vh;
    overflow-y: auto;
    
    /* hide scrollbar */
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE / Edge */
}

/*-----------------------------------
    DROPBOX 
---------------------------------- */
#dropzone {
        width: 100%; 
        padding: 30px;
        background: #fff;
        border: 1px dashed var(--contrast-3);
        border-radius: 5px; 
        text-align: center; 
        color: var(--contrast-2);
        cursor: pointer; 
        margin-bottom: 0px;
}
#dropzone:hover {
    border-color: var(--accent-3);
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.25);
}
#dropzone.disabled {
/*    background: #f8d7da;*/
    border-color: #dc3545;
    cursor: not-allowed;
    opacity: 0.85;
}

#dropzone.disabled * {
    pointer-events: none;
}

#thumbnails { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 12px;
    margin-bottom: 20px;
}
.thumb { 
    width: 140px; 
    border:1px solid var(--contrast-3); 
    border-radius:5px; 
    padding:0px; 
    text-align:center; 
    position:relative; 
    background:#fafafa;
}
.thumb img { 
    width:100%; 
    height:140px; 
    object-fit:cover; 
    border-top-left-radius: 5px; 
    border-top-right-radius: 5px;
}
.pdf-thumb, .cad-thumb {
    width:100%;
    height:140px; 
    display:flex; 
    align-items:center; 
    justify-content:center;
    margin-bottom: 10px;
    background:#eee; 
    border-top-left-radius: 6px; 
    border-top-right-radius: 6px;
    font-size:14px; 
    color:#333;
}
input[type="text"].rename-field {
    width: 132px;
    margin: 0 auto;
    padding: 5px;
    background-color: #fff;
    border-color: var(--contrast-3);
    border-radius: 3px;
    font-size: 0.75rem;
}
input[type="text"].rename-field:hover,
input[type="text"].rename-field:focus {
    border-color: var(--accent-3);
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.25);
}
.removeBtn { 
    position:absolute; 
    top:-8px; 
    right:-8px; 
    padding: 0;
    background: var(--accent); 
    color:white; 
    border:none;
    width:22px;
    height:22px;
    border-radius: 50%;
    cursor:pointer; 
    font-size:12px;
}
#warning { 
    color:red; 
    font-weight:bold; 
    display:none; 
    margin-bottom:10px; 
}
#uploadPopup { 
    display:none; 
    position:fixed; 
    top:0; 
    left:0; 
    width:100%; 
    height:100%; 
    background:rgba(0,0,0,0.6); 
    justify-content:center;
    align-items:center; 
    z-index:99999;
}
#uploadPopup .popup-content { 
    background:white; 
    padding:25px; 
    border-radius:10px; 
    max-width:350px; 
    text-align:center;
}
#uploadProgressBar { 
    width:100%; 
    height:20px; 
    margin-top:15px;
}

@media (max-width: 600px) {
  .image-option-vertical {
    width: 100%;
    max-width: 350px;
  }
}
/* ========== Upload Progress Info ========= */
#fileList {
    list-style: none;
    margin: 0;
    padding: 0;
}

#fileList li {
    padding: 6px 0;
    font-size: 14px;
}

/* states */
.pending {
    color: #777;
}

.uploading {
    color: #0066cc;
}

.success {
    color: #2e7d32;
}

.error {
    color: #c62828;
}
.pending::before {
    content: "⏳ ";
}

.uploading::before {
    content: "⬆️ ";
}

.success::before {
    content: "✅ ";
}

.error::before {
    content: "❌ ";
}
button.popup-button {
    margin: 0 15px;
    border-radius: 5px;
}

/* -----------------------------------------------------------------------------
    CONTACT FORM Recipient Name
   --------------------------------------------------------------------------- */
.recipient-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 1rem;
}

#recipientClear {
    background: none;
    border: 0;
    color: var(--contrast-3);
    font-size: 1.5em;
    cursor: pointer;
    line-height: 1;
}
/* ----- BOUNCE  effect ----- */
@keyframes focus-bounce {
    0%   { transform: translateY(0); }
    30%  { transform: translateY(-6px); }
    60%  { transform: translateY(3px); }
    100% { transform: translateY(0); }
}

/* animation class */
.focus-bounce {
    animation: focus-bounce 450ms ease-out;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .focus-bounce {
        animation: none;
    }
}
/* ----- PULSE effect ----- */
@keyframes focus-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.focus-pulse {
    animation: focus-pulse 400ms ease-out;
    animation-iteration-count: 2;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .focus-pulse {
        animation: none;
    }
}


