﻿/* The "Këshillohu" / "Apliko" modal shared by the loan pages (Views/Partials/LoanOfferModal.cshtml,
   scripts/loan-offer-modal.js). Self-contained, so it looks the same whichever page stylesheet is loaded; colours and
   fonts come from the site tokens in site.css. */

.lom {
    --lom-brand: var(--color-brand, #54243D);
    --lom-brand-dark: #3f1a2d;
    --lom-text: var(--color-text, #1a1a1a);
    --lom-muted: var(--color-text-muted, #555);
    --lom-line: rgba(84, 36, 61, 0.12);
    --lom-border: rgba(84, 36, 61, 0.28);
    --lom-tint: rgba(84, 36, 61, 0.06);
    --lom-surface: var(--color-cream, #fefcf5);
    --lom-error: #c0392b;
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 3vw, 40px);
    font-family: var(--font-primary, 'Inter', system-ui, -apple-system, sans-serif);
    font-size: 15px;
    line-height: 1.5;
    color: var(--lom-text);
}

    .lom[hidden],
    .lom [hidden] {
        display: none !important;
    }

    .lom *,
    .lom *::before,
    .lom *::after {
        box-sizing: border-box;
    }

    .lom svg {
        width: 18px;
        height: 18px;
        flex: 0 0 auto;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.lom__overlay {
    position: absolute;
    inset: 0;
    background: rgba(24, 10, 16, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.lom__panel {
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #ffffff;
    border-radius: 20px;
    padding: clamp(22px, 3.2vw, 32px);
    box-shadow: 0 40px 90px -40px rgba(17, 17, 17, 0.6);
    animation: lom-pop 0.3s cubic-bezier(.16, 1, .3, 1) both;
}

    .lom__panel:focus {
        outline: none;
    }

.lom__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: var(--lom-muted);
    cursor: pointer;
}

    .lom__close:hover {
        color: var(--lom-brand);
        background: var(--lom-tint);
    }

/* ── Header ── */

.lom__head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    /* Clear of the close button. */
    padding-right: 40px;
}

.lom__title {
    margin: 0;
    font-family: var(--font-primary, 'Inter', sans-serif);
    font-size: clamp(20px, 2.2vw, 23px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--lom-brand);
}

.lom__ref {
    display: inline-block;
    margin: 0;
    padding: 4px 12px;
    border: 1px solid rgba(84, 36, 61, 0.22);
    border-radius: 999px;
    background: rgba(84, 36, 61, 0.09);
    color: var(--lom-brand);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.lom__step {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--lom-muted);
}

/* ── Review ── */

.lom__tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.lom__tile {
    min-width: 0;
    padding: 14px 18px;
    border-radius: 14px;
    background: var(--lom-surface);
    border: 1px solid var(--lom-line);
}

.lom__tile-label {
    margin: 0;
    font-size: 14px;
    color: var(--lom-muted);
}

.lom__tile-value {
    margin: 2px 0 0;
    font-size: clamp(19px, 2.4vw, 25px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--lom-brand);
    overflow-wrap: anywhere;
}

.lom__section {
    margin-top: 26px;
}

.lom__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.lom__section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-family: var(--font-primary, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--lom-brand);
}

.lom__edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--lom-border);
    border-radius: 999px;
    background: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--lom-brand);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

    .lom__edit svg {
        width: 15px;
        height: 15px;
    }

    .lom__edit:hover {
        background: var(--lom-tint);
        border-color: var(--lom-brand);
    }

.lom__rows {
    margin: 0;
}

.lom__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--lom-line);
}

    .lom__row:last-child {
        border-bottom: 0;
    }

    .lom__row dt {
        flex: 0 0 auto;
        color: var(--lom-muted);
    }

    .lom__row dd {
        margin: 0;
        min-width: 0;
        text-align: right;
        font-weight: 500;
        color: var(--lom-text);
        overflow-wrap: anywhere;
    }

.lom__bank {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--lom-text);
}

    .lom__bank img {
        display: block;
        max-width: 56px;
        max-height: 22px;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .lom__bank svg {
        color: var(--lom-brand);
    }

/* ── Fields ── */

.lom__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    padding-top: 8px;
}

.lom__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.lom__field--wide {
    grid-column: 1 / -1;
}

.lom__field label {
    font-size: 14px;
    color: var(--lom-muted);
}

.lom__field input,
.lom__field select,
.lom__field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--lom-border);
    border-radius: 10px;
    background: #ffffff;
    font: inherit;
    font-size: 15px;
    color: var(--lom-text);
}

.lom__field textarea {
    min-height: 84px;
    resize: vertical;
}

    .lom__field input:focus-visible,
    .lom__field select:focus-visible,
    .lom__field textarea:focus-visible,
    .lom__confirm input:focus-visible,
    .lom__btn:focus-visible,
    .lom__edit:focus-visible,
    .lom__link:focus-visible,
    .lom__close:focus-visible {
        outline: 2px solid var(--lom-brand);
        outline-offset: 2px;
    }

.lom__field--invalid input,
.lom__field--invalid select {
    border-color: var(--lom-error);
}

.lom__field-error {
    margin: 0;
    font-size: 13px;
    color: var(--lom-error);
}

.lom__field--message {
    margin-top: 26px;
}

.lom__optional {
    color: var(--lom-muted);
    opacity: 0.8;
}

.lom__confirm {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 22px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--lom-text);
    cursor: pointer;
}

    .lom__confirm input {
        flex: 0 0 auto;
        width: 18px;
        height: 18px;
        margin: 1px 0 0;
        accent-color: var(--lom-brand);
        cursor: pointer;
    }

.lom__error {
    margin: 14px 0 0;
    font-size: 14px;
    color: var(--lom-error);
}

.lom__note {
    margin: 14px 0 0;
    font-size: 14px;
    color: var(--lom-brand);
}

/* ── Buttons ── */

.lom__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 26px;
}

.lom__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 24px;
    border: 1px solid var(--lom-brand);
    border-radius: 999px;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.3s cubic-bezier(.34, 1.56, .64, 1);
}

.lom__btn--primary {
    background: var(--lom-brand);
    color: #ffffff;
}

    .lom__btn--primary:hover {
        background: var(--lom-brand-dark);
        transform: translateY(-1px);
    }

.lom__btn--ghost {
    border-color: var(--lom-border);
    background: #ffffff;
    color: var(--lom-brand);
}

    .lom__btn--ghost:hover {
        background: var(--lom-tint);
    }

.lom__btn[disabled] {
    opacity: 0.6;
    cursor: progress;
    transform: none;
}

.lom__link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--lom-brand);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

    .lom__link[disabled] {
        color: var(--lom-muted);
        text-decoration: none;
        cursor: default;
    }

/* ── Code ── */

.lom__lead {
    margin: 22px 0 0;
    color: var(--lom-text);
}

    .lom__lead strong {
        color: var(--lom-brand);
        overflow-wrap: anywhere;
    }

.lom__field--code {
    margin-top: 22px;
    max-width: 280px;
}

    .lom__field--code input {
        min-height: 56px;
        font-size: 26px;
        font-weight: 600;
        letter-spacing: 0.45em;
        text-align: center;
        font-variant-numeric: tabular-nums;
        color: var(--lom-brand);
    }

.lom__resend {
    margin: 16px 0 0;
    font-size: 14px;
    color: var(--lom-muted);
}

/* ── Sent ── */

.lom__success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px 0 4px;
    text-align: center;
}

.lom__success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(84, 36, 61, 0.09);
    color: var(--lom-brand);
}

    .lom__success-icon svg {
        width: 32px;
        height: 32px;
        stroke-width: 2.4;
    }

.lom__success-title {
    margin: 4px 0 0;
    font-family: var(--font-primary, 'Inter', sans-serif);
    font-size: clamp(20px, 2.4vw, 24px);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--lom-brand);
}

.lom__success-text {
    margin: 0;
    max-width: 420px;
    color: var(--lom-muted);
    overflow-wrap: anywhere;
}

.lom__success .lom__btn {
    margin-top: 10px;
    min-width: 160px;
}

/* ── Bits ── */

.lom__trap {
    position: absolute !important;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.lom--busy .lom__panel {
    cursor: progress;
}

body.lom-open {
    overflow: hidden;
}

@keyframes lom-pop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 560px) {
    .lom {
        padding: 12px;
        font-size: 14.5px;
    }

    .lom__panel {
        border-radius: 16px;
        padding: 20px 16px;
    }

    .lom__tiles {
        gap: 10px;
    }

    .lom__tile {
        padding: 12px 14px;
    }

    .lom__fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .lom__row {
        gap: 12px;
    }

    .lom__actions .lom__btn {
        flex: 1 1 0;
        padding: 11px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lom__panel {
        animation: none;
    }

    .lom__btn {
        transition: none;
    }
}
