/* Visual styles from the verified NEXO CRM login view. */
:root {
    /* zjednotené podľa detail.php */
    --p: #00a4d3;
    --p-d: #008bb3;
    --p-soft: #f0fbff;
    --p-mid: #b3e4f0;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border2: #f1f5f9;
    --text: #334155;
    --muted: #64748b;
    --light: #94a3b8;
    --success: #10b981;
    --suc-bg: #ecfdf5;
    --warn: #f59e0b;
    --warn-bg: #fffbeb;
    --danger: #ef4444;
    --dan-bg: #fef2f2;
    --font: 'DM Sans', sans-serif;
    --mono: 'DM Mono', monospace;
    --r: 8px;
    --r-sm: 6px;
    --sh: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.02);
    --sh-md: 0 4px 12px rgba(0,0,0,.06);
    --sh-lg: 0 18px 45px rgba(15, 23, 42, .10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { min-height: 100%; height: 100%; background: #f8fafc; }

body {
    font-family: var(--font);
    background:
        radial-gradient(circle at top left, rgba(0,164,211,.08), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 58%, #f1f5f9 100%);
    background-color: #f8fafc;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.4;
    font-size: 11px;
    -webkit-font-smoothing: antialiased;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100svh;
    padding: 24px;
    overflow-x: hidden;
}

.login-shell {
    position: relative;
    width: min(100%, 880px);
    min-height: 520px;
    display: grid;
    place-items: center;
}

.login-card-wrap {
    position: relative;
    width: 100%;
    max-width: 390px;
}

.login-card {
    position: relative;
    width: 100%;
    background: rgba(255,255,255,.96);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--sh-lg);
    padding: 26px 26px 22px;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--p), #38bdf8, var(--success));
}
.login-logo-head {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0 24px;
}

.login-brand-lockup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    padding: 2px 0;
}

.login-brand-icon {
    width: 42px;
    height: 42px;
    display: block;
    flex: 0 0 auto;
    filter: drop-shadow(0 10px 18px rgba(15, 23, 42, .10));
}

.login-brand-wordmark {
    width: 126px;
    height: auto;
    display: block;
    flex: 0 0 auto;
}

.login-brand-lockup .st0,
.login-transition-mark .st0 { fill: #acddf6; }
.login-brand-lockup .st1,
.login-transition-mark .st1 { fill: #0d1625; }
.login-brand-lockup .st2,
.login-transition-mark .st2 { fill: #4ebbec; }
.login-brand-lockup .st3,
.login-transition-mark .st3 { fill: #27357b; }

.status-strip {
    display: block;
    color: #64748b;
    margin-top: 17px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 1.35;
    letter-spacing: .01em;
}

.status-strip i { display: none; }

form { display: flex; flex-direction: column; gap: 13px; text-align: left; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--muted);
    margin-left: 1px;
}

.input-wrap { position: relative; }

.input-wrap i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light);
    font-size: 12px;
    pointer-events: none;
}

input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 32px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    color: var(--text);
    transition: .18s ease;
    box-shadow: inset 0 1px 0 rgba(15,23,42,.02);
}

input::placeholder { color: #cbd5e1; font-weight: 500; }

input:focus {
    outline: none;
    border-color: var(--p);
    box-shadow: 0 0 0 3px rgba(0,164,211,.09);
}

.login-btn {
    width: 100%;
    height: 34px;
    margin-top: 4px;
    padding: 0 14px;
    background: var(--p);
    color: #fff;
    border: none;
    border-radius: var(--r-sm);
    font-family: var(--font);
    font-weight: 700;
    font-size: 11.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(0,164,211,.22);
    transition: .2s ease;
}

.login-btn:hover { background: var(--p-d); transform: translateY(-1px); }

.login-provider-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 15px 0 12px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em;
}

.login-provider-divider::before,
.login-provider-divider::after {
    content: '';
    height: 1px;
    flex: 1 1 auto;
    background: var(--border);
}

.google-login-button {
    position: relative;
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 44px;
    border: 1px solid #cbd5e1;
    border-radius: var(--r-sm);
    background: #fff;
    color: var(--text);
    font-family: var(--font);
    font-size: 11.5px;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    transition: .18s ease;
}

.google-login-button:hover,
.google-login-button:focus-visible {
    border-color: #94a3b8;
    background: #f8fafc;
    color: var(--text);
    box-shadow: 0 0 0 3px rgba(148,163,184,.13);
    outline: none;
    text-decoration: none;
}

.google-login-button.is-pending {
    cursor: default;
    border-style: solid;
    color: #475569;
    box-shadow: none;
}

.google-login-button.is-pending:hover,
.google-login-button.is-pending:focus-visible {
    border-color: #cbd5e1;
    background: #fff;
    box-shadow: none;
}

.google-login-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    display: block;
}

.register-link {
    width: 100%;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: #fff;
    color: var(--text);
    font-size: 11.5px;
    font-weight: 750;
    text-decoration: none;
    transition: .18s ease;
}

.register-link:hover {
    border-color: rgba(0, 164, 211, .34);
    background: rgba(0, 164, 211, .06);
    color: var(--p-d);
    text-decoration: none;
}

.forgot-password-link {
    display: inline-flex;
    align-self: flex-end;
    margin-top: -5px;
    color: var(--p-d);
    font-size: 10.5px;
    font-weight: 750;
    text-decoration: none;
}

.forgot-password-link:hover { text-decoration: underline; }

input:disabled, .login-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* Malá bublinka pri karte, nie hore vnútri rámiku */
.flash-bubble {
    position: absolute;
    top: 152px;
    left: calc(100% + 10px);
    min-width: 185px;
    max-width: 230px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid transparent;
    box-shadow: var(--sh-md);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    animation: bubbleIn .22s ease-out;
}

.flash-bubble::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: inherit;
    border-left: inherit;
    border-bottom: inherit;
}

.flash-bubble.error {
    background: var(--dan-bg);
    color: #b91c1c;
    border-color: #fecaca;
}

.flash-bubble.success {
    background: var(--suc-bg);
    color: #047857;
    border-color: #bbf7d0;
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateX(-4px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Bezpečnostný modal */
.security-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 34%, rgba(0,164,211,.16), transparent 34%),
        rgba(15, 23, 42, .36);
    backdrop-filter: blur(8px) saturate(1.08);
    -webkit-backdrop-filter: blur(8px) saturate(1.08);
    z-index: 1000;
    padding: 18px;
}

.security-modal {
    width: min(100%, 468px);
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(213, 226, 238, .92);
    border-radius: 24px;
    box-shadow: 0 28px 90px rgba(15, 23, 42, .22);
    overflow: hidden;
    animation: modalIn .28s cubic-bezier(.2,.8,.2,1);
    position: relative;
}

.security-modal::before { display: none; }

.security-modal.is-ip-blocked {
    width: min(100%, 430px);
    text-align: center;
}

.security-modal.is-ip-blocked .security-modal-head {
    display: block;
    padding: 34px 28px 18px;
    border-bottom: 0;
}

.security-modal.is-ip-blocked .security-modal-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: 24px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 18px 42px rgba(220,38,38,.22);
    font-size: 24px;
}

.security-modal.is-ip-blocked .security-modal-title {
    font-size: 22px;
    line-height: 1.14;
    letter-spacing: -.45px;
    max-width: 330px;
    margin: 0 auto;
}

.security-modal.is-ip-blocked .security-modal-subtitle {
    margin: 10px auto 0;
    max-width: 315px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 700;
}

.security-modal.is-ip-blocked .security-close {
    position: absolute;
    top: 16px;
    right: 16px;
    margin: 0;
}

.security-block-simple {
    padding: 0 30px 34px;
}

.security-block-simple-list {
    margin: 4px auto 0;
    max-width: 330px;
    display: grid;
    gap: 10px;
    text-align: center;
}

.security-block-simple-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 800;
}

.security-block-simple-label {
    color: #8a9ab0;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .8px;
}

.security-block-simple-value {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 950;
    word-break: break-word;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(14px) scale(.982); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.security-modal-head {
    padding: 24px 24px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border-bottom: 1px solid rgba(226,232,240,.82);
}

.security-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #00a4d3, #12b8cf);
    box-shadow: 0 14px 28px rgba(0,164,211,.22);
    flex-shrink: 0;
}

.security-modal-title {
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -.35px;
    line-height: 1.18;
}

.security-modal-subtitle {
    margin-top: 7px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 650;
}

.security-close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: .18s;
    font-size: 16px;
}

.security-close:hover { background: rgba(0,164,211,.08); color: #0f172a; }

.security-modal-body { padding: 20px 24px 24px; }

.timer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.timer-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .9px;
}

.security-timer {
    font-family: var(--mono);
    font-size: 25px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -.5px;
}

.security-block-card {
    margin-top: 14px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248,251,253,.98), rgba(255,255,255,.98));
    border: 1px solid rgba(213,226,238,.92);
}
.security-block-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.security-block-item { min-width: 0; }
.security-block-label {
    font-size: 10px;
    line-height: 1;
    color: #8a9ab0;
    text-transform: uppercase;
    letter-spacing: .75px;
    font-weight: 900;
    margin-bottom: 7px;
}
.security-block-value {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 800;
    word-break: break-word;
}
.security-block-reason {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(226,232,240,.92);
    color: #64748b;
    font-size: 12.5px;
    line-height: 1.55;
    font-weight: 650;
}
.security-block-foot {
    margin-top: 14px;
    color: #8a9ab0;
    font-size: 11.5px;
    line-height: 1.45;
    font-weight: 700;
}

.timer-bar {
    height: 7px;
    background: #ffedd5;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #fed7aa;
}

.timer-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--warn), #fb923c);
    border-radius: inherit;
    transition: width .35s linear;
}

.security-chip {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 8px;
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #9a3412;
    border-radius: 999px;
    padding: 9px 13px;
    box-shadow: var(--sh-md);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    z-index: 900;
}

.security-chip.show { display: inline-flex; }
.security-chip strong { font-family: var(--mono); color: #c2410c; font-weight: 500; }

@media (max-width: 1024px) and (min-width: 761px) {
    body {
        min-height: 100svh;
        align-items: center;
        justify-content: center;
        padding: 24px 22px;
    }
    .login-shell {
        width: min(100%, 720px);
        min-height: calc(100svh - 48px);
        padding: 0;
        display: grid;
        place-items: center;
    }
    .login-card-wrap {
        max-width: 390px;
        transform: translateY(-22px);
    }
}

@media (max-width: 760px) {
    html {
        min-height: 100%;
        background:
            radial-gradient(circle at top left, rgba(0,164,211,.075), transparent 42%),
            linear-gradient(180deg, #ffffff 0%, #f8fbfd 56%, #f2f6fa 100%);
        background-color: #f8fafc;
        background-repeat: no-repeat;
        background-attachment: fixed;
    }
    html, body {
        width: 100%;
        min-height: 100svh;
        min-height: 100dvh;
        overflow-x: hidden;
    }
    body {
        min-height: 100svh;
        min-height: 100dvh;
        align-items: center;
        justify-content: center;
        padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
        background:
            radial-gradient(circle at top left, rgba(0,164,211,.075), transparent 42%),
            linear-gradient(180deg, #ffffff 0%, #f8fbfd 56%, #f2f6fa 100%);
        background-color: #f8fafc;
        background-repeat: no-repeat;
        background-attachment: fixed;
    }
    .login-shell {
        width: 100%;
        min-height: calc(100svh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        min-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .login-card-wrap {
        max-width: 100%;
        width: min(100%, 390px);
        transform: none;
        margin: 0;
    }
    .login-card {
        padding: 22px 18px 20px;
        border-radius: 16px;
    }
    .brand {
        justify-content: center;
        text-align: left;
        margin-bottom: 20px;
    }
    .brand-title { font-size: 17px; }
    .status-strip {
        margin-top: 16px;
        padding: 10px 11px;
        font-size: 10.8px;
    }
    .flash-bubble {
        position: static;
        margin-top: 12px;
        min-width: 0;
        max-width: none;
        width: 100%;
    }
    .flash-bubble::before { display: none; }
    .security-modal { width: min(100%, 390px); }
    .security-modal-head { padding: 20px 18px 15px; }
    .security-modal-body { padding: 16px 18px 20px; }
    .security-block-grid { grid-template-columns: 1fr; gap: 11px; }
    .security-chip {
        left: 16px;
        right: 16px;
        bottom: 14px;
        transform: none;
        justify-content: center;
        width: auto;
    }
}

@media (max-width: 420px) {
    body {
        padding-left: 12px;
        padding-right: 12px;
    }
    .login-card-wrap {
        width: 100%;
        margin: 0;
    }
    .login-card { padding: 20px 16px 18px; }
    .login-logo-head { margin-bottom: 18px; }
    .login-brand-icon { width: 36px; height: 36px; }
    .login-brand-wordmark { width: 112px; }
    .login-brand-lockup { gap: 10px; }
    input { height: 42px; }
    .login-btn { height: 42px; }
}

@media (max-width: 420px) and (max-height: 740px) {
    .login-card-wrap { margin: 0; }
    .login-card { padding-top: 18px; padding-bottom: 16px; }
    .login-logo-head { margin-bottom: 15px; }
    .field { margin-bottom: 13px; }
    .status-strip { margin-top: 14px; }
}


/* Success-only welcome handoff animation */
.login-card-wrap.is-leaving .login-card {
    animation: cardHandoff .42s cubic-bezier(.22,.72,.2,1) forwards;
    transform-origin: center;
}

@keyframes cardHandoff {
    0% { transform: translateY(0) scale(1); opacity: 1; filter: blur(0); }
    100% { transform: translateY(8px) scale(.985); opacity: .08; filter: blur(8px); }
}

.login-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 45%, rgba(0,164,211,.075), transparent 28%),
        rgba(248,251,253,.90);
    backdrop-filter: blur(0px);
    transition: opacity .26s ease, visibility .26s ease, backdrop-filter .32s ease;
}

.login-transition-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

.login-transition-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(760px, 94vw);
    min-height: 128px;
    gap: 18px;
    transform: translateY(8px);
    opacity: 0;
}

.login-transition-overlay.show .login-transition-stage {
    animation: welcomeStageIn .36s cubic-bezier(.22,.72,.2,1) forwards;
}

@keyframes welcomeStageIn {
    to { opacity: 1; transform: translateY(0); }
}

.login-transition-welcome {
    margin: 0;
    width: 100%;
    max-width: 94vw;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: clamp(22px, 4.2vw, 36px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.04em;
    color: var(--ink);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#loginTransitionName {
    white-space: nowrap;
}

.login-transition-subtitle {
    margin-top: -7px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
}

.login-transition-loader {
    position: relative;
    z-index: 3;
    width: 230px;
    max-width: 62vw;
    height: 4px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148,163,184,.18);
    opacity: 0;
    transform: translateY(4px);
}

.login-transition-loader span {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--p), #38bdf8, #10b981);
    transform: translateX(-100%);
}

.login-transition-overlay.show .login-transition-loader {
    animation: loaderReveal .18s ease .12s forwards;
}

.login-transition-overlay.show .login-transition-loader span {
    animation: loaderMove 1.55s cubic-bezier(.42,0,.16,1) .18s forwards;
}

@keyframes loaderReveal { to { opacity: 1; transform: translateY(0); } }
@keyframes loaderMove { to { transform: translateX(0); } }

@media (max-width: 520px) {
    .login-transition-stage { width: 94vw; min-height: 112px; gap: 15px; }
    .login-transition-welcome { font-size: clamp(19px, 5.2vw, 28px); }
    .login-transition-loader { width: 190px; max-width: 70vw; }
    .login-transition-subtitle { font-size: 10px; letter-spacing: .14em; }
}

:root { --ink: #0f172a; }
.market-login-label { color: var(--p-d); text-align: center; font-size: 11px; letter-spacing: .16em; font-weight: 800; margin: -9px 0 20px; }
.market-login-note { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.market-login-error { margin: 9px 0; min-height: 1em; color: #991b1b; font-size: 12px; }
.market-login-error:empty { display: none; }
.market-auth-link { display: block; margin-top: 8px; text-align: center; color: var(--muted); font-size: 11px; }
.market-continue { position: relative; z-index: 2; }
.login-transition-overlay[data-ready="yes"] .market-continue { pointer-events: auto; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
