/* ========================================================================
   Page: Register (/Account/Register) — javna registracija (probni nalog).
   Nasleđuje login.css (isti shell, intro-side, card, fields). Ovo dodaje:
   - toggle "Pravno / Fizičko lice"
   - skriveni blokovi polja po izboru
   - kompaktnija forma (manji gap-ovi, manji card-head, niža polja)
   - SMS verifikacija (Verify) sa OTP poljem
   ======================================================================== */

.intro-side .intro-list li::before {
    content: "✓";
    color: var(--c-brand);
    margin-right: 6px;
    font-weight: 700;
}

/* Kompaktnija varijanta forme za registraciju (više polja u istom kartonu) */
body .card-head { margin-bottom: 14px; }
body .card-head h1 { font-size: 22px; line-height: 1.15; }
body .card-head p { font-size: 13px; }

body .form { gap: 11px; }
body .field { gap: 4px; }
body .label { font-size: 12.5px; }
body .input { height: 40px; border-radius: 11px; font-size: 14px; padding: 0 12px; }
body .field-error { min-height: 0; font-size: 12px; }
body .field-hint { font-size: 11.5px; margin-top: 2px; }

body .btn { height: 44px; font-size: 14.5px; }

/* Toggle: Pravno / Fizičko lice */
.entity-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 2px 0 14px;
}

.entity-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.entity-toggle label {
    cursor: pointer;
    border: 2px solid var(--c-border);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--p-white);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .15s ease;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 64px;
}

.entity-toggle label:hover {
    border-color: var(--c-focus-ring-border);
    background: var(--c-surface-card-tint);
}

.entity-toggle .et-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--p-app-surface-3);
    color: var(--p-slate-500);
    flex-shrink: 0;
    transition: background .15s ease, color .15s ease;
}
.entity-toggle .et-ico svg {
    width: 20px;
    height: 20px;
}

.entity-toggle .et-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.entity-toggle .et-title {
    font-weight: 700;
    color: var(--c-text-strong);
    font-size: 14px;
    line-height: 1.2;
}

.entity-toggle .et-sub {
    color: var(--c-text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.entity-toggle .et-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--c-border);
    background: var(--p-white);
    color: var(--p-white);
    flex-shrink: 0;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.entity-toggle .et-check svg {
    width: 13px;
    height: 13px;
    opacity: 0;
    transition: opacity .15s ease;
}

.entity-toggle input:checked + label {
    border-color: var(--c-brand);
    box-shadow: 0 0 0 3px rgba(var(--p-brand-rgb),.18), 0 4px 12px rgba(var(--p-brand-rgb),.10);
    background: linear-gradient(180deg, var(--c-surface-page-soft) 0%, var(--c-brand-surface) 100%);
    transform: translateY(-1px);
}

.entity-toggle input:checked + label .et-ico {
    background: var(--c-brand);
    color: var(--p-white);
}

.entity-toggle input:checked + label .et-check {
    background: var(--c-brand);
    border-color: var(--c-brand);
    transform: scale(1.05);
}
.entity-toggle input:checked + label .et-check svg {
    opacity: 1;
}

.entity-toggle input:checked + label .et-title {
    color: var(--c-brand);
}

.entity-toggle input:focus-visible + label {
    outline: 3px solid var(--c-focus-ring-border);
    outline-offset: 2px;
}

/* Fizičko lice — „USKORO" kao najava (teaser), ne disabled: čist izgled, samo se ne bira. */
.entity-toggle label.et-soon {
    cursor: default;
    border-style: dashed;
}
.entity-toggle label.et-soon:hover {
    border-color: var(--c-border);
    background: var(--p-white);
    transform: none;
    box-shadow: none;
}
.entity-toggle label.et-soon .et-ico {
    background: var(--c-brand-surface);
    color: var(--c-brand);
}
.et-soon-badge {
    justify-self: end;
    align-self: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--c-brand-surface);
    color: var(--c-brand);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    white-space: nowrap;
}

/* Conditional field groups */
.entity-fields[hidden] { display: none !important; }
.entity-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.entity-fields .field--full { grid-column: 1 / -1; }

@media (max-width: 560px) {
    .entity-toggle { grid-template-columns: 1fr; }
    .entity-fields { grid-template-columns: 1fr; }
}

/* ── Koraci (Korak 1 firma / Korak 2 nalog) ─────────────────────────────── */
/* Legal blok nije grid (sadrži jedan .step wrapper); Natural ostaje 2-kolonski grid. */
.entity-fields--legal { display: block; }
.entity-fields--legal[hidden] { display: none !important; }

.step { position: relative; }
.step + .step { margin-top: 16px; }

.step-head {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--c-brand);
    color: var(--p-white);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.step-head-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.step-title { font-weight: 700; color: var(--c-text-strong); font-size: 14px; line-height: 1.2; }
.step-sub { color: var(--c-text-muted); font-size: 12px; line-height: 1.35; }

/* Korak 1 — red za unos identifikatora + confirm ikonica */
.lookup-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.lookup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: 0;
    background: var(--c-brand);
    color: var(--p-white);
    cursor: pointer;
    flex-shrink: 0;
    transition: filter .15s ease, opacity .15s ease;
}
.lookup-btn:hover { filter: brightness(1.05); }
.lookup-btn:disabled { opacity: .6; cursor: default; }
.lookup-btn svg { width: 18px; height: 18px; }
.lookup-btn.is-loading { pointer-events: none; }
.lookup-btn.is-loading svg { animation: login-btn-spin .7s linear infinite; }

.lookup-msg { font-size: 12.5px; margin: 8px 0 0; line-height: 1.4; }
.lookup-msg--error { color: var(--c-danger-strong); }
.lookup-msg--ok { color: var(--c-success-strong); }

/* Povučeni podaci — readonly grid */
.lookup-result {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
    animation: lookup-reveal .18s ease;
}
.lookup-result[hidden] { display: none; }
.lookup-result .field--full { grid-column: 1 / -1; }
.lookup-result .input[readonly] {
    background: var(--p-app-surface-3);
    color: var(--c-text-strong);
    cursor: default;
}
@keyframes lookup-reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* Korak 2 — zaključano stanje dok firma nije potvrđena */
.step--account { transition: opacity .2s ease; }
.step--account.is-locked { opacity: .45; }
.step--account.is-locked .step-num { background: var(--c-border); }
.step--account:not(.is-locked) [data-account-lock-hint] { display: none; }

@media (max-width: 560px) {
    .lookup-result { grid-template-columns: 1fr; }
}

/* Acceptance row */
.accept-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    color: var(--c-text-muted);
    margin: 2px 0 8px;
}

.accept-row input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--c-brand);
}

.accept-row a { color: var(--c-brand); text-decoration: underline; }

/* Verify (SMS kod) — jednoredni unos OTP koda */
.code-input {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .4em;
    font-size: 22px;
    font-weight: 700;
}

.verify-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 13px;
}

.verify-actions a, .verify-actions button.linkbtn {
    color: var(--c-brand);
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
    padding: 0;
}

/* Loading state za link-dugme (SMS resend traje) — mali brand ring-spinner desno. */
.verify-actions button.linkbtn.is-loading {
    pointer-events: none;
    opacity: .6;
    position: relative;
    padding-right: 20px;
}
.verify-actions button.linkbtn.is-loading::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    margin-top: -7px;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(var(--p-brand-rgb), .3);
    border-top-color: var(--c-brand);
    border-radius: 50%;
    animation: login-btn-spin .7s linear infinite;
}

.field-hint {
    color: var(--c-text-muted);
    font-size: 12px;
    margin-top: 4px;
}
