/* --- Keskkond & Partnerid — Highlight Section Frontend CSS --- */

/* ═══════════════════════════════════════════════════════
   SEKTSIOON
═══════════════════════════════════════════════════════ */

.kphl-section {
    --kphl-accent: #032e68;
    --kphl-cta:    #e95e23;
    --kphl-ctc:    #ffffff;
    padding: 80px 0;
    box-sizing: border-box;
}

/* Konteiner — alati keskel */
.kphl-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 48px;
    display: flex;
    align-items: center;
    gap: 64px;
    box-sizing: border-box;
    justify-content: center;
}

/* Teksti veerg — alati täislaius, keskel */
.kphl-text-col {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
}

/* Pildiga versioon — tekst vasakul */
.kphl-section.kphl-has-image .kphl-container  { justify-content: flex-start; }
.kphl-section.kphl-has-image .kphl-text-col   { text-align: left; }
.kphl-section.kphl-has-image .kphl-stats      { justify-content: flex-start; }
.kphl-section.kphl-has-image .kphl-cta        { margin: 0; }

/* Statistika ja CTA — keskel kui pole pilti */
.kphl-stats { justify-content: center; }
.kphl-cta   { margin: 0 auto; }

/* Badge */
.kphl-badge {
    display: inline-block;
    background: var(--kphl-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: 6px 18px;
    border-radius: 20px;
    margin-bottom: 24px;
}

/* Pealkiri */
.kphl-title {
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 800;
    color: var(--kphl-accent);
    line-height: 1.15;
    margin: 0 0 24px;
}

/* Intro */
.kphl-intro {
    font-size: clamp(22px, 2.2vw, 27px);
    font-weight: 300;
    line-height: 1.8;
    color: #444;
    margin: 0 auto 36px;
    max-width: 680px;
}

/* Statistika */
.kphl-stats {
    display: flex;
    gap: 48px;
    margin-bottom: 44px;
    flex-wrap: wrap;
}
.kphl-stat { display: flex; flex-direction: column; }

.kphl-stat-num {
    font-size: clamp(38px, 4vw, 52px);
    font-weight: 800;
    color: var(--kphl-accent);
    line-height: 1;
}
.kphl-stat-label {
    font-size: 13px;
    color: #777;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 700;
}

/* CTA nupp */
.kphl-cta {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    background: var(--kphl-cta);
    color: var(--kphl-ctc);
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    padding: 17px 34px;
    border-radius: 8px;
    letter-spacing: .02em;
    transition: filter .2s, transform .2s, box-shadow .2s;
    box-shadow: 0 4px 18px rgba(233,94,35,.32);
    font-family: inherit;
}
.kphl-cta:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(233,94,35,.38);
}
.kphl-cta svg { flex-shrink: 0; width: 20px; height: 20px; }

/* ── Pilt veerg (ainult layout=left + pilt seadistatud) ── */
.kphl-image-col { flex: 0 0 420px; position: relative; }
.kphl-image-wrap { position: relative; }
.kphl-img {
    width: 100%;
    border-radius: 16px;
    display: block;
    box-shadow: 0 20px 60px rgba(3,46,104,.15);
    position: relative; z-index: 2;
}
.kphl-img-deco {
    position: absolute;
    bottom: -20px; right: -20px;
    width: 200px; height: 200px;
    border: 3px solid var(--kphl-cta);
    border-radius: 16px;
    z-index: 1; opacity: .4;
}

/* ═══════════════════════════════════════════════════════
   IKOONID / EELISED
═══════════════════════════════════════════════════════ */

.kphl-icons-row {
    max-width: 1100px;
    margin: 56px auto 0;
    padding: 0 48px;
    box-sizing: border-box;
}
.kphl-icons-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 24px;
    padding-top: 44px;
    border-top: 1px solid rgba(3,46,104,.1);
}

.kphl-icon-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 26px;
    background: #fff;
    border: 1px solid rgba(3,46,104,.08);
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(0,0,0,.04);
    transition: transform .2s, box-shadow .2s;
}
.kphl-icon-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(3,46,104,.1);
}
.kphl-icon-wrap {
    width: 52px; height: 52px;
    background: rgba(3,46,104,.07);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px;
    color: var(--kphl-accent); flex-shrink: 0;
}
.kphl-icon-wrap svg { width: 26px; height: 26px; }

.kphl-icon-title {
    font-size: 22px;
    font-weight: 700;
    color: #032e68;
    line-height: 1.25;
    margin: 0 0 8px;
}
.kphl-icon-desc {
    font-size: 19px;
    font-weight: 300;
    color: #666;
    line-height: 1.45;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════
   SCROLL ANIMATSIOONID
═══════════════════════════════════════════════════════ */

.kphl-fade-init {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .45s ease, transform .45s ease;
}
.kphl-fade-init.kphl-visible { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════════════════
   KONTAKTIMODAL
═══════════════════════════════════════════════════════ */

.kphl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity .2s;
}
.kphl-modal-overlay:not(.kphl-hidden) { display: flex; }
.kphl-modal-overlay.kphl-open         { opacity: 1; }
.kphl-modal-overlay.kphl-hidden       { display: none !important; }

.kphl-modal-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 24px 80px rgba(0,0,0,.25);
    padding: 36px;
    box-sizing: border-box;
    position: relative;
    transform: translateY(24px);
    transition: transform .25s;
    max-height: 92vh;
    overflow-y: auto;
}
.kphl-modal-overlay.kphl-open .kphl-modal-box { transform: translateY(0); }

.kphl-modal-close {
    position: absolute; top: 16px; right: 16px;
    background: #f4f4f4; border: none; cursor: pointer;
    border-radius: 50%; width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    color: #555; transition: background .15s, color .15s;
}
.kphl-modal-close:hover { background: #032e68; color: #fff; }

.kphl-modal-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.kphl-modal-icon {
    width: 52px; height: 52px;
    background: #f0f4ff; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #032e68; flex-shrink: 0;
}
.kphl-modal-title { margin: 0; font-size: 20px; font-weight: 800; color: #032e68; }
.kphl-modal-sub   { margin: 4px 0 0; color: #888; font-size: 13px; }

.kphl-modal-contacts {
    display: flex; gap: 12px; flex-wrap: wrap;
    margin-bottom: 24px; padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}
.kphl-modal-contact-item {
    display: inline-flex; align-items: center; gap: 8px;
    background: #f8f9ff; border: 1px solid #e0e4f8; border-radius: 8px;
    padding: 10px 14px; color: #032e68; text-decoration: none;
    font-size: 14px; font-weight: 600;
    transition: background .15s, border-color .15s, color .15s;
}
.kphl-modal-contact-item:hover { background: #032e68; color: #fff; border-color: #032e68; }
.kphl-modal-contact-item svg { flex-shrink: 0; }

.kphl-modal-form  { display: flex; flex-direction: column; gap: 14px; }
.kphl-form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kphl-form-group  { display: flex; flex-direction: column; gap: 5px; }
.kphl-form-group label {
    font-size: 11px; font-weight: 700; color: #555;
    letter-spacing: .05em; text-transform: uppercase;
}
.kphl-form-group label span { color: #e95e23; }
.kphl-form-group input,
.kphl-form-group textarea {
    border: 1.5px solid #e0e0e0; border-radius: 7px;
    padding: 10px 14px; font-size: 14px; color: #222;
    outline: none; transition: border-color .15s, box-shadow .15s;
    font-family: inherit; box-sizing: border-box; width: 100%; background: #fff;
}
.kphl-form-group input:focus,
.kphl-form-group textarea:focus { border-color: #032e68; box-shadow: 0 0 0 3px rgba(3,46,104,.1); }
.kphl-form-group input.kphl-error,
.kphl-form-group textarea.kphl-error { border-color: #e74c3c; box-shadow: 0 0 0 3px rgba(231,76,60,.08); }
.kphl-form-group textarea { resize: vertical; min-height: 100px; }

.kphl-form-footer { display: flex; justify-content: flex-end; }
.kphl-form-submit {
    background: #e95e23; color: #fff; border: none; border-radius: 7px;
    padding: 13px 28px; font-size: 15px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: filter .2s, transform .2s; font-family: inherit;
}
.kphl-form-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.kphl-form-submit:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.kphl-spin { animation: kphl-spin 1s linear infinite; }
@keyframes kphl-spin { to { transform: rotate(360deg); } }

.kphl-form-msg { padding: 12px 16px; border-radius: 7px; font-size: 14px; font-weight: 600; }
.kphl-form-msg.kphl-success { background: #eafaf1; color: #1e8449; border: 1px solid #a9dfbf; }
.kphl-form-msg.kphl-error   { background: #fdedeb; color: #c0392b; border: 1px solid #f5b7b1; }

/* ═══════════════════════════════════════════════════════
   MOBIIL
═══════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .kphl-section   { padding: 60px 0; }
    .kphl-container { flex-direction: column; gap: 40px; padding: 0 28px; }
    .kphl-image-col { flex: none; width: 100%; max-width: 480px; margin: 0 auto; }
    .kphl-icons-row { padding: 0 28px; }
    .kphl-icons-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .kphl-section   { padding: 44px 0; }
    .kphl-container { padding: 0 20px; }
    .kphl-icons-row { padding: 0 20px; margin-top: 36px; }
    .kphl-icons-inner { grid-template-columns: 1fr; }
    .kphl-stats     { gap: 28px; }
    .kphl-img-deco  { display: none; }
    .kphl-modal-box { padding: 24px 20px; }
    .kphl-form-row  { grid-template-columns: 1fr; }
    .kphl-modal-contacts { flex-direction: column; }
}
