/* =====================================================
   e-Novčanik Demo — Mobile-first wallet UI
   ===================================================== */

:root {
    --bg: #0a0f1a;
    --bg-2: #0f1724;
    --bg-3: #151f30;
    --bg-card: rgba(255, 255, 255, 0.04);

    --cyan: #60d2fa;
    --cyan-bright: #7de0ff;
    --cyan-dark: #3ba5c9;

    --purple: #7c3aed;
    --green: #10b981;
    --red: #ef4444;
    --orange: #f59e0b;

    --text: #e8eef7;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(96, 210, 250, 0.3);

    --grad-cyan: linear-gradient(135deg, #60d2fa 0%, #3ba5c9 100%);
    --grad-bank: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --grad-wallet: linear-gradient(135deg, #0e7490 0%, #60d2fa 100%);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    user-select: none;
}

/* Pozadinski radial gradient */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 10%, rgba(96, 210, 250, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(124, 58, 237, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* App shell — mobile-first */
.app-shell {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* =====================================================
   Screen sistem (modalni ekrani)
   ===================================================== */

/* =====================================================
   HOME ekran - obican page flow (NIJE fixed)
   ===================================================== */
#screen-home {
    width: 100%;
    background: var(--bg);
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
    /* Bez position:fixed - prosto regularan page flow */
}

/* =====================================================
   MODAL ekrani (IPS Setup, IPS QR, Edit) - fixed overlay
   ===================================================== */
.screen:not(#screen-home) {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateX(100%);
    width: 100%;
    max-width: 480px;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height */
    background: var(--bg);
    transition: transform 0.3s var(--ease-out);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.screen:not(#screen-home).active {
    transform: translateX(-50%);
}

/* Universal modal screen layout */
.screen-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.screen-footer {
    flex-shrink: 0;
    padding: 1rem 1.2rem max(1rem, env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
}

.screen-footer .btn-primary,
.screen-footer .btn-secondary {
    width: 100%;
}

/* =====================================================
   Header
   ===================================================== */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.2rem 1rem;
    padding-top: max(1.5rem, calc(env(safe-area-inset-top) + 0.5rem));
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--grad-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(96, 210, 250, 0.3);
}

.greeting {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.icon-btn:active {
    transform: scale(0.95);
    background: rgba(96, 210, 250, 0.1);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   Modal Header
   ===================================================== */

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    padding-top: max(1.2rem, env(safe-area-inset-top));
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.back-btn:active {
    transform: scale(0.95);
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   Balance kartice
   ===================================================== */

.balances {
    display: flex;
    gap: 0.8rem;
    padding: 0.5rem 1.2rem 1.2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.balances::-webkit-scrollbar { display: none; }

.balance-card {
    flex: 0 0 calc(100% - 0.6rem);
    min-width: 280px;
    border-radius: 20px;
    padding: 1.4rem;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform 0.2s var(--ease);
}

.balance-card:active { transform: scale(0.98); }

.bank-card { background: var(--grad-bank); }
.wallet-card { background: var(--grad-wallet); }

.balance-card-bg {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
    top: -50px;
    right: -50px;
    pointer-events: none;
}

.balance-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 1;
}

.balance-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.balance-icon svg {
    width: 20px;
    height: 20px;
}

.edit-balance {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.edit-balance:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.25);
}

.edit-balance svg {
    width: 14px;
    height: 14px;
}

.balance-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    position: relative;
    z-index: 1;
}

.balance-amount {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    position: relative;
    z-index: 1;
}

.balance-amount .value {
    color: white;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.balance-amount .currency {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 600;
}

.balance-account {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
}

/* =====================================================
   Quick Actions
   ===================================================== */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    padding: 0 1.2rem 1.5rem;
}

.action-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 0.4rem;
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s var(--ease);
    font-family: inherit;
}

.action-btn:active {
    transform: scale(0.95);
    background: rgba(96, 210, 250, 0.1);
}

.action-btn.primary {
    background: var(--grad-cyan);
    border-color: transparent;
    color: var(--bg);
    box-shadow: 0 4px 16px rgba(96, 210, 250, 0.35);
}

.action-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon svg {
    width: 100%;
    height: 100%;
}

.action-btn span {
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
}

/* =====================================================
   Transactions
   ===================================================== */

.transactions {
    padding: 0 1.2rem;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.section-title a {
    color: var(--cyan);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.tx-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.tx-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: all 0.2s var(--ease);
}

.tx-item:active {
    background: rgba(96, 210, 250, 0.06);
    transform: scale(0.99);
}

.tx-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(96, 210, 250, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tx-icon.salary { background: rgba(16, 185, 129, 0.15); }
.tx-icon.shop { background: rgba(245, 158, 11, 0.15); }
.tx-icon.transfer { background: rgba(124, 58, 237, 0.15); }

.tx-info {
    flex: 1;
    min-width: 0;
}

.tx-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.tx-amount {
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
}

.tx-amount.positive { color: var(--green); }
.tx-amount.negative { color: var(--text); }

/* =====================================================
   Bottom Navigation
   ===================================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    background: rgba(10, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 50;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: color 0.2s var(--ease);
    font-family: inherit;
}

.nav-item.active {
    color: var(--cyan);
}

.nav-item svg {
    width: 22px;
    height: 22px;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-fab {
    width: 56px;
    height: 56px;
    background: var(--grad-cyan);
    color: var(--bg);
    border-radius: 50%;
    margin-top: -1.5rem;
    box-shadow: 0 6px 20px rgba(96, 210, 250, 0.5);
    transition: all 0.2s var(--ease);
}

.nav-fab:active {
    transform: scale(0.92);
}

.nav-fab svg {
    width: 24px;
    height: 24px;
}

/* =====================================================
   IPS Setup Screen
   ===================================================== */

/* QR content - centered layout */
.qr-content {
    align-items: center;
    text-align: center;
    gap: 1.2rem !important;
}

/* =====================================================
   Account toggle (e-Novcanik / Bankarski racun)
   ===================================================== */
.account-toggle {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 4px;
    width: 100%;
    gap: 4px;
}

.account-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: inherit;
}

.account-tab.active {
    background: var(--grad-cyan);
    color: var(--bg);
    box-shadow: 0 2px 8px rgba(96, 210, 250, 0.3);
}

.account-tab:not(.active):active {
    background: rgba(96, 210, 250, 0.08);
}

/* =====================================================
   QR Timer (countdown)
   ===================================================== */
.qr-timer-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(96, 210, 250, 0.1);
    border: 1px solid rgba(96, 210, 250, 0.3);
    border-radius: 100px;
    color: var(--cyan);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s var(--ease);
}

.qr-timer-wrap svg {
    width: 16px;
    height: 16px;
}

.qr-timer-wrap.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--orange);
    animation: timerPulse 1s ease-in-out infinite;
}

.qr-timer-wrap.hidden {
    display: none;
}

.qr-timer {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 700;
    margin-left: 0.2rem;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

/* =====================================================
   QR Expired overlay
   ===================================================== */
.qr-expired-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 24px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    color: var(--bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeInOverlay 0.3s ease;
}

.qr-expired-overlay.visible {
    display: flex;
}

.qr-expired-overlay svg {
    width: 48px;
    height: 48px;
    color: var(--red);
    margin-bottom: 0.6rem;
}

.qr-expired-overlay h3 {
    color: var(--bg);
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
    font-weight: 700;
}

.qr-expired-overlay p {
    color: #475569;
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    max-width: 200px;
    line-height: 1.4;
}

.qr-expired-overlay .btn-primary {
    width: auto;
    padding: 0.7rem 1.4rem;
    font-size: 0.9rem;
}

@keyframes fadeInOverlay {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* =====================================================
   QR Account info card
   ===================================================== */
.qr-account-info {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.qr-account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qr-account-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.qr-account-value {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.ips-info {
    display: flex;
    gap: 0.8rem;
    padding: 1rem;
    background: rgba(96, 210, 250, 0.08);
    border: 1px solid rgba(96, 210, 250, 0.2);
    border-radius: 14px;
}

.ips-info-icon {
    flex-shrink: 0;
    color: var(--cyan);
    width: 24px;
    height: 24px;
}

.ips-info-icon svg {
    width: 100%;
    height: 100%;
}

.ips-info p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.amount-section label,
.source-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.amount-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.2rem;
    transition: border-color 0.2s var(--ease);
}

.amount-input-wrap:focus-within {
    border-color: var(--cyan);
    background: rgba(96, 210, 250, 0.04);
}

.amount-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 2rem;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: -0.02em;
    width: 100%;
    min-width: 0;
}

.amount-input-wrap input::placeholder {
    color: var(--text-dim);
}

.amount-currency {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.quick-amounts {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.quick-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem 0.3rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: inherit;
}

.quick-btn:active {
    transform: scale(0.95);
    background: rgba(96, 210, 250, 0.1);
    border-color: var(--cyan);
}

/* Source options */
.source-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.source-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: inherit;
    color: var(--text);
    text-align: left;
}

.source-option.active {
    border-color: var(--cyan);
    background: rgba(96, 210, 250, 0.08);
}

.source-option:active {
    transform: scale(0.99);
}

.source-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.source-amount {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.source-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    transition: all 0.2s var(--ease);
}

.source-check svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    transition: opacity 0.2s var(--ease);
}

.source-option.active .source-check {
    background: var(--cyan);
    border-color: var(--cyan);
}

.source-option.active .source-check svg {
    opacity: 1;
}

/* Primary button */
.btn-primary {
    background: var(--grad-cyan);
    color: var(--bg);
    border: none;
    border-radius: 14px;
    padding: 1.1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(96, 210, 250, 0.35);
    transition: all 0.2s var(--ease);
    font-family: inherit;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.4;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: inherit;
}

.btn-secondary:active {
    transform: scale(0.98);
    background: rgba(96, 210, 250, 0.08);
}

/* =====================================================
   QR Display
   ===================================================== */

.qr-content {
    align-items: center;
    text-align: center;
}

.qr-amount-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.qr-amount-display #qr-amount-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--cyan-bright) 0%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.qr-amount-display .qr-currency {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-muted);
}

.qr-source {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(96, 210, 250, 0.1);
    border: 1px solid rgba(96, 210, 250, 0.3);
    border-radius: 100px;
    color: var(--cyan);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.qr-container {
    position: relative;
    margin: 1rem 0;
}

.qr-frame {
    background: white;
    padding: 1.5rem;
    border-radius: 24px;
    box-shadow:
        0 0 0 1px rgba(96, 210, 250, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(96, 210, 250, 0.2);
    position: relative;
    display: inline-block;
}

.qr-frame canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Decorative corners on QR */
.qr-corners {
    position: absolute;
    inset: -8px;
    pointer-events: none;
}

.qr-corners::before,
.qr-corners::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid var(--cyan);
}

.qr-corners::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-radius: 8px 0 0 0;
}

.qr-corners::after {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-radius: 0 0 8px 0;
}

.qr-ips-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    background: var(--grad-cyan);
    color: var(--bg);
    padding: 0.4rem 0.8rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 4px 12px rgba(96, 210, 250, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qr-ips-badge svg {
    width: 12px;
    height: 12px;
}

.qr-instructions h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.qr-instructions p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 280px;
}

.qr-status {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 100px;
    color: var(--orange);
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.status-pulse {
    width: 8px;
    height: 8px;
    background: var(--orange);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--orange);
    animation: pulseStatus 1.5s ease-in-out infinite;
}

@keyframes pulseStatus {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 12px var(--orange);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 20px var(--orange), 0 0 30px rgba(245, 158, 11, 0.5);
    }
}


/* =====================================================
   Desktop view (>480px) — centriraj sadrzaj
   ===================================================== */
@media (min-width: 481px) {
    body {
        background: var(--bg);
    }

    .bottom-nav {
        max-width: 480px;
    }
}


/* =====================================================
   ============= POS DEMO STYLES =====================
   ===================================================== */

.pos-body {
    background: var(--bg);
}

.pos-screen {
    background: var(--bg);
}

#pos-home {
    width: 100%;
    background: var(--bg);
    padding-bottom: 2rem;
    min-height: 100dvh;
}

/* POS Header */
.pos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    padding-top: max(1.2rem, env(safe-area-inset-top));
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
}

.pos-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.pos-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--grad-cyan);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-logo svg {
    width: 22px;
    height: 22px;
}

.pos-title {
    font-weight: 700;
    color: var(--text);
    font-size: 0.95rem;
}

.pos-subtitle {
    font-size: 0.75rem;
    color: var(--cyan);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pos-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 100px;
    color: var(--green);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pulse.online {
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulseStatus 1.5s ease-in-out infinite;
}

/* POS Content */
.pos-content {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* Receipt */
.pos-receipt {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.4rem;
}

.pos-merchant h2 {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.pos-merchant-info {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.pos-receipt-divider {
    height: 1px;
    background: var(--border);
    margin: 1rem 0;
    background-image: linear-gradient(to right, var(--border) 50%, transparent 50%);
    background-size: 8px 1px;
}

.pos-items {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pos-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.pos-item-name {
    color: var(--text);
}

.pos-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.pos-total-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.pos-total-value {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.pos-total-value #pos-total-amount {
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--grad-cyan);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pos-currency {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
}

/* Payment Methods */
.pos-payment-methods h3 {
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
}

.pos-method-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.pos-method {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 0.4rem;
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s var(--ease);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
}

.pos-method:active {
    transform: scale(0.96);
}

.pos-method.primary {
    background: var(--grad-cyan);
    border-color: transparent;
    color: var(--bg);
    box-shadow: 0 4px 16px rgba(96, 210, 250, 0.35);
}

.pos-method-icon {
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-method-icon svg {
    width: 100%;
    height: 100%;
}

/* Amount edit */
.pos-amount-edit label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =====================================================
   Scanner screen
   ===================================================== */
#pos-scanner {
    display: flex;
    flex-direction: column;
}

.scanner-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #000;
    position: relative;
}

.scanner-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
    min-height: 300px;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.scanner-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scan frame corners */
.scanner-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 4px solid var(--cyan);
}

.scanner-corner.tl {
    top: 22%;
    left: calc(50% - 130px);
    border-right: none;
    border-bottom: none;
    border-radius: 8px 0 0 0;
}

.scanner-corner.tr {
    top: 22%;
    right: calc(50% - 130px);
    border-left: none;
    border-bottom: none;
    border-radius: 0 8px 0 0;
}

.scanner-corner.bl {
    bottom: 22%;
    left: calc(50% - 130px);
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 8px;
}

.scanner-corner.br {
    bottom: 22%;
    right: calc(50% - 130px);
    border-left: none;
    border-top: none;
    border-radius: 0 0 8px 0;
}

/* Scanning line animation */
.scanner-line {
    position: absolute;
    left: calc(50% - 130px);
    right: calc(50% - 130px);
    top: 22%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    box-shadow: 0 0 12px var(--cyan), 0 0 24px var(--cyan);
    animation: scanLine 2s ease-in-out infinite;
}

@keyframes scanLine {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(220px); opacity: 0.6; }
}

.scanner-instruction {
    padding: 1.2rem;
    background: var(--bg);
    text-align: center;
}

.scan-amount-display {
    margin-bottom: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(96, 210, 250, 0.08);
    border: 1px solid rgba(96, 210, 250, 0.25);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scan-amount-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.scan-amount-value {
    color: var(--cyan);
    font-size: 1.05rem;
    font-weight: 800;
}

.scanner-instruction p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

/* =====================================================
   Success screen
   ===================================================== */
#pos-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.2rem;
}

.success-content {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.2rem;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.success-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--grad-cyan);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(96, 210, 250, 0.5);
    animation: successPop 0.5s var(--ease-out);
}

.success-icon svg {
    width: 50px;
    height: 50px;
}

@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.success-content h1 {
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.success-amount {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.success-amount #success-amount {
    font-size: 2.8rem;
    font-weight: 800;
    background: var(--grad-cyan);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.success-currency {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-muted);
}

.success-details {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.success-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.success-label {
    color: var(--text-muted);
    font-weight: 500;
}

.success-value {
    color: var(--text);
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.85rem;
    word-break: break-word;
    text-align: right;
}

.success-fiscal {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 100px;
    color: var(--green);
    font-size: 0.8rem;
    font-weight: 600;
}

.success-fiscal svg {
    width: 14px;
    height: 14px;
}

#btn-new-transaction {
    margin-top: 0.5rem;
    width: 100%;
    max-width: 280px;
}
