/* ═══════════════════════════════════════════
 * TIMLI – Pristopna izjava (multi-step form)
 * Uporablja CF :root spremenljivke
 * ═══════════════════════════════════════════ */

/* ─── FORM WRAPPER ─── */
.tpi-form {
    max-width: 780px;
    margin: 0 auto;
    padding: var(--space-m);
    font-family: inherit;
    color: var(--text-body);
}

/* ─── PROGRESS BAR ─── */
.tpi-progress {
    margin-bottom: var(--space-l);
}
.tpi-progress__bar {
    height: 4px;
    background: var(--dark-10);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-s);
}
.tpi-progress__fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}
.tpi-progress__steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-3xs);
}
.tpi-progress__step {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 2px solid var(--dark-20);
    background: var(--bg-surface);
    color: var(--dark-40);
    font-size: var(--text-s);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}
.tpi-progress__step.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: scale(1.1);
}
.tpi-progress__step.done {
    background: var(--primary-l-3);
    border-color: var(--primary-l-2);
    color: var(--primary-d-2);
}
.tpi-progress__labels {
    display: flex;
    justify-content: space-between;
}
.tpi-progress__labels span {
    font-size: var(--text-xs);
    color: var(--dark-30);
    text-align: center;
    flex: 1;
    transition: color 0.2s;
}
.tpi-progress__labels span.active {
    color: var(--primary);
    font-weight: 600;
}

/* ─── STEPS ─── */
.tpi-step {
    display: none;
    animation: tpiFadeIn 0.35s ease;
}
.tpi-step.active {
    display: block;
}
@keyframes tpiFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tpi-step__header {
    margin-bottom: var(--space-m);
}
.tpi-step__title {
    font-size: var(--text-xl);
    color: var(--primary);
    margin: 0 0 var(--space-3xs) 0;
    font-weight: 700;
}
.tpi-step__desc {
    font-size: var(--text-s);
    color: var(--dark-50);
    margin: 0;
}

/* ─── GRID ─── */
.tpi-grid {
    display: grid;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}
.tpi-grid--1 { grid-template-columns: 1fr; }
.tpi-grid--2 { grid-template-columns: 1fr 1fr; }
.tpi-grid--3 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 600px) {
    .tpi-grid--2,
    .tpi-grid--3 {
        grid-template-columns: 1fr;
    }
}

/* ─── FIELD ─── */
.tpi-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xs);
}
.tpi-field > label {
    font-size: var(--text-s);
    font-weight: 600;
    color: var(--text-title);
}
.tpi-input {
    padding: var(--space-3xs) var(--space-s);
    font-size: var(--text-m);
    color: var(--text-title);
    background: var(--bg-surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-xs);
    transition: all 0.2s ease;
    outline: 0;
    width: 100%;
    box-sizing: border-box;
}
.tpi-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-20);
}
.tpi-input::placeholder {
    color: var(--dark-30);
}
.tpi-input[readonly] {
    background: var(--dark-5);
    cursor: default;
}

/* ─── PASS FIELD ─── */
.tpi-pass-wrap {
    position: relative;
}
.tpi-pass-wrap .tpi-input {
    padding-right: 48px;
}
.tpi-pass-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    line-height: 1;
}

/* ─── RADIO ROW ─── */
.tpi-radio-row {
    display: flex;
    gap: var(--space-m);
    flex-wrap: wrap;
}
.tpi-radio-label {
    display: flex;
    align-items: center;
    gap: var(--space-3xs);
    font-size: var(--text-s);
    cursor: pointer;
    color: var(--text-body);
}
.tpi-radio-label input[type="radio"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

/* ─── CARD CHOICE (Korak 1) ─── */
.tpi-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-s);
}
@media (max-width: 600px) {
    .tpi-cards { grid-template-columns: 1fr; }
}
.tpi-card-choice {
    cursor: pointer;
}
.tpi-card-choice input { display: none; }
.tpi-card-choice__inner {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    padding: var(--space-m);
    background: var(--bg-surface);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-s);
    transition: all 0.25s ease;
    position: relative;
}
.tpi-card-choice:hover .tpi-card-choice__inner {
    border-color: var(--primary-40);
    box-shadow: var(--shadow-m);
    transform: translateY(-2px);
}
.tpi-card-choice.selected .tpi-card-choice__inner {
    border-color: var(--primary);
    background: var(--primary-5);
    box-shadow: 0 0 0 3px var(--primary-20);
}
.tpi-card-choice__icon {
    font-size: 2.4rem;
    flex-shrink: 0;
}
.tpi-card-choice__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tpi-card-choice__content strong {
    font-size: var(--text-m);
    color: var(--text-title);
}
.tpi-card-choice__content span {
    font-size: var(--text-s);
    color: var(--dark-50);
}
.tpi-card-choice__check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    border: 2px solid var(--dark-20);
    border-radius: var(--radius-full);
    transition: all 0.2s;
}
.tpi-card-choice.selected .tpi-card-choice__check {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: inset 0 0 0 3px #fff;
}

/* ─── INFO BOX ─── */
.tpi-info-box {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
    padding: var(--space-s);
    background: var(--info);
    border-radius: var(--radius-m);
    font-size: var(--text-s);
    color: var(--primary-d-2);
    margin-bottom: var(--space-m);
    border-left: 4px solid var(--primary-l-2);
}
.tpi-info-box__icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ─── FILE DROP ─── */
.tpi-file-drop {
    position: relative;
    border: 2px dashed var(--border-primary);
    border-radius: var(--radius-m);
    overflow: hidden;
    transition: border-color 0.2s;
    margin-bottom: var(--space-s);
}
.tpi-file-drop:hover {
    border-color: var(--primary-40);
}
.tpi-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.tpi-file-drop__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3xs);
    padding: var(--space-l) var(--space-m);
    text-align: center;
}
.tpi-file-drop__icon {
    font-size: 2rem;
}
.tpi-file-drop__text {
    font-size: var(--text-s);
    font-weight: 600;
    color: var(--primary);
}
.tpi-file-drop__sub {
    font-size: var(--text-xs);
    color: var(--dark-40);
}
.tpi-file-drop__preview {
    position: relative;
    padding: var(--space-s);
    text-align: center;
}
.tpi-file-drop__preview img {
    max-height: 180px;
    border-radius: var(--radius-s);
    object-fit: contain;
}
.tpi-file-drop__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--error);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

/* ─── SOGLASJA ─── */
.tpi-soglasja {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-m);
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-s);
    background: var(--dark-5);
    border-radius: var(--radius-m);
    border: 1px solid var(--border-primary);
}
.tpi-soglasje h4 {
    font-size: var(--text-s);
    color: var(--primary);
    margin: 0 0 2px 0;
    font-weight: 700;
}
.tpi-soglasje p {
    font-size: var(--text-xs);
    color: var(--dark-60);
    margin: 0;
    line-height: 1.5;
}

/* ─── SIGNATURE ─── */
.tpi-signature {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}
.tpi-signature canvas {
    width: 100%;
    height: 200px;
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-m);
    background: #fff;
    cursor: crosshair;
    touch-action: none;
}

/* ─── FINAL AGREE ─── */
.tpi-final-agree {
    padding: var(--space-m);
    background: var(--primary-5);
    border: 2px solid var(--primary-30);
    border-radius: var(--radius-m);
    margin: var(--space-m) 0;
}
.tpi-checkbox-label {
    display: flex;
    gap: var(--space-s);
    align-items: flex-start;
    cursor: pointer;
    font-size: var(--text-s);
    color: var(--text-body);
    line-height: 1.5;
}
.tpi-checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ─── NAVIGATION ─── */
.tpi-nav {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    padding-top: var(--space-m);
    border-top: 1px solid var(--border-primary);
    margin-top: var(--space-m);
}
.tpi-nav__spacer {
    flex: 1;
}

/* ─── BUTTONS ─── */
.tpi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-l);
    font-size: var(--text-m);
    font-weight: 600;
    border-radius: var(--radius-m);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: 0;
    white-space: nowrap;
}
.tpi-btn--primary {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-m);
}
.tpi-btn--primary:hover {
    background: var(--primary-d-1);
    transform: translateY(-1px);
    box-shadow: var(--shadow-l);
}
.tpi-btn--submit {
    background: var(--success);
    color: #fff;
    box-shadow: var(--shadow-m);
    font-size: var(--text-l);
    padding: var(--space-s) var(--space-xl);
}
.tpi-btn--submit:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}
.tpi-btn--ghost {
    background: transparent;
    color: var(--dark-60);
    border: 1px solid var(--border-primary);
}
.tpi-btn--ghost:hover {
    background: var(--dark-5);
    color: var(--text-title);
}
.tpi-btn--small {
    font-size: var(--text-s);
    padding: var(--space-3xs) var(--space-s);
}

/* ─── DIVIDER LABEL ─── */
.tpi-divider-label {
    font-size: var(--text-m);
    font-weight: 700;
    color: var(--primary);
    margin: var(--space-l) 0 var(--space-s) 0;
    padding-bottom: var(--space-3xs);
    border-bottom: 2px solid var(--primary-20);
}

/* ─── OTROK REPEATER BLOCK ─── */
.tpi-otrok-block {
    background: var(--bg-surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-s);
    padding: var(--space-m);
    margin-bottom: var(--space-m);
    position: relative;
}
.tpi-otrok-block__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-s);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-primary);
}
.tpi-otrok-block__header strong {
    font-size: var(--text-m);
    color: var(--primary);
}
.tpi-otrok-remove {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--error-10);
    color: var(--error);
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.tpi-otrok-remove:hover {
    background: var(--error);
    color: #fff;
}

/* ─── ADD BUTTON ─── */
.tpi-btn--add {
    width: 100%;
    border: 2px dashed var(--primary-40);
    color: var(--primary);
    background: var(--primary-5);
    padding: var(--space-s);
}
.tpi-btn--add:hover {
    background: var(--primary-10);
    border-color: var(--primary);
}

/* ─── NOTICES ─── */
.tpi-notice {
    padding: var(--space-m);
    border-radius: var(--radius-m);
    font-size: var(--text-s);
    margin-bottom: var(--space-m);
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}
.tpi-notice--success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}
.tpi-notice--error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}
.tpi-notice--info {
    background: var(--info);
    border: 1px solid var(--primary-l-3);
    color: var(--primary-d-2);
}

/* ─── MOBILE ─── */
@media (max-width: 480px) {
    .tpi-form {
        padding: var(--space-s);
    }
    .tpi-progress__step {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    .tpi-step__title {
        font-size: var(--text-l);
    }
    .tpi-btn {
        padding: var(--space-xs) var(--space-m);
        font-size: var(--text-s);
    }
    .tpi-btn--submit {
        font-size: var(--text-m);
        padding: var(--space-xs) var(--space-l);
    }
    .tpi-card-choice__inner {
        padding: var(--space-s);
    }
    .tpi-card-choice__icon {
        font-size: 1.8rem;
    }
    .tpi-nav {
        flex-wrap: wrap;
    }
    .tpi-nav__spacer {
        display: none;
    }
    .tpi-nav .tpi-btn {
        flex: 1;
    }
}