/* ============================================
   Portal Client Admiral Media — CSS local
   Inlocuieste complet Tailwind CDN
   ============================================ */

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

:root {
    --brand:       #2563eb;
    --brand-dark:  #1d4ed8;
    --brand-light: #eff6ff;
    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --green-50:  #f0fdf4;
    --green-100: #dcfce7;
    --green-600: #16a34a;
    --green-700: #15803d;
    --green-800: #166534;
    --red-50:  #fef2f2;
    --red-100: #fee2e2;
    --red-600: #dc2626;
    --red-700: #b91c1c;
    --red-800: #991b1b;
    --yellow-50:  #fefce8;
    --yellow-100: #fef9c3;
    --yellow-600: #ca8a04;
    --yellow-700: #a16207;
    --yellow-800: #854d0e;
    --blue-100: #dbeafe;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --purple-100: #f3e8ff;
    --purple-700: #7e22ce;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    color: var(--gray-900);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
}

/* ---------- AUTH / WIZARD LAYOUT ---------- */
.pt-body-auth {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem 1rem;
}
.auth-wrap { width: 100%; max-width: 32rem; margin: 0 auto; }
.auth-head { text-align: center; margin-bottom: 2rem; }
.auth-head h1 { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); margin: 0; }
.auth-head p  { font-size: 0.875rem; color: var(--gray-500); margin: 0.25rem 0 0; }
.auth-foot { text-align: center; font-size: 0.75rem; color: var(--gray-400); margin-top: 1.5rem; }

.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    padding: 2rem;
}
.card-title { font-size: 1.25rem; font-weight: 600; color: var(--gray-900); margin: 0 0 0.25rem; }
.card-sub   { font-size: 0.875rem; color: var(--gray-500); margin: 0 0 1.5rem; }

/* ---------- PROGRESS BAR ---------- */
.progress-wrap { margin-bottom: 1.5rem; }
.progress-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.progress-meta .step { font-size: 0.75rem; font-weight: 500; color: var(--gray-500); }
.progress-meta .label { font-size: 0.75rem; color: var(--gray-400); }
.progress-track { width: 100%; background: var(--gray-100); border-radius: 9999px; height: 0.375rem; overflow: hidden; }
.progress-fill { background: var(--brand); height: 100%; border-radius: 9999px; transition: width .3s; }

/* ---------- FORMS ---------- */
.field { margin-bottom: 1rem; }
.field label, .lbl {
    display: block; font-size: 0.875rem; font-weight: 500;
    color: var(--gray-700); margin-bottom: 0.25rem;
}
.input, input[type=text], input[type=email], input[type=password],
input[type=tel], input[type=url], select, textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--gray-900);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.hint { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.25rem; }
.err  { font-size: 0.75rem; color: var(--red-600); margin-top: 0.25rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 480px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.625rem 1rem; border-radius: 0.5rem; font-size: 0.875rem;
    font-weight: 500; font-family: inherit; cursor: pointer; border: none;
    text-decoration: none; transition: background .15s, border-color .15s; width: 100%;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-success { background: var(--green-600); color: #fff; }
.btn-success:hover { background: var(--green-700); }
.btn-outline { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-200); }
.btn-row { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.btn-row .btn { flex: 1; }

/* ---------- RADIO CARDS (limba / tip client) ---------- */
.radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.radio-card { cursor: pointer; display: block; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card .box {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem; border: 2px solid var(--gray-200);
    border-radius: 0.75rem; transition: border-color .15s, background .15s;
}
.radio-card .box:hover { border-color: var(--gray-300); }
.radio-card input:checked + .box { border-color: var(--brand); background: var(--brand-light); }
.radio-card .emoji { font-size: 1.5rem; }
.radio-card .name { font-size: 0.875rem; font-weight: 600; color: var(--gray-900); }
.radio-card .desc { font-size: 0.75rem; color: var(--gray-500); }
.radio-card.block-card { display: block; margin-bottom: 0.75rem; }

/* ---------- FILE UPLOAD ---------- */
.upload {
    border: 2px dashed var(--gray-200); border-radius: 0.75rem;
    padding: 1rem; transition: border-color .15s; cursor: pointer; display: block;
}
.upload:hover { border-color: #93c5fd; }
.upload .t { font-size: 0.875rem; font-weight: 500; color: var(--gray-700); margin: 0; }
.upload .s { font-size: 0.75rem; color: var(--gray-400); margin: 0.125rem 0 0; }
.upload input[type=file] { margin-top: 0.5rem; font-size: 0.75rem; color: var(--gray-500); width: 100%; }
.upload .ok { font-size: 0.75rem; color: var(--green-600); margin-top: 0.25rem; }

/* ---------- ALERTS ---------- */
.alert { padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; margin-bottom: 1rem; }
.alert-error { background: var(--red-50); border: 1px solid var(--red-100); color: var(--red-700); }
.alert-success { background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-700); }
.alert-info { background: var(--brand-light); border: 1px solid var(--blue-100); color: var(--blue-700); }

/* ---------- LINKS / MISC ---------- */
.link { color: var(--brand); text-decoration: none; }
.link:hover { color: var(--brand-dark); }
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.muted { color: var(--gray-400); }
.sep { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-100); text-align: center; }
.checkbox-row { display: flex; align-items: center; justify-content: space-between; }
.checkbox-row label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--gray-600); cursor: pointer; }

/* ---------- AUTHENTICATED APP (sidebar) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px; background: #fff; border-right: 1px solid var(--gray-200);
    display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.sidebar-logo { padding: 1.5rem; border-bottom: 1px solid var(--gray-100); }
.sidebar-logo .brand { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); text-decoration: none; }
.sidebar-logo .sub { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.125rem; }
.sidebar-user { padding: 1rem; border-bottom: 1px solid var(--gray-100); background: var(--gray-50); }
.sidebar-user .nm { font-size: 0.875rem; font-weight: 600; color: var(--gray-800); margin: 0; }
.sidebar-user .org { font-size: 0.75rem; color: var(--gray-500); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav { flex: 1; padding: 1rem; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem;
    border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500;
    color: var(--gray-600); text-decoration: none; transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: var(--gray-100); }
.sidebar-nav a.active { background: var(--brand-light); color: var(--blue-700); }
.sidebar-nav a svg { width: 1rem; height: 1rem; }
.sidebar-foot { padding: 1rem; border-top: 1px solid var(--gray-100); }
.sidebar-foot button {
    display: flex; align-items: center; gap: 0.5rem; width: 100%;
    padding: 0.5rem 0.75rem; border: none; background: none; cursor: pointer;
    font-size: 0.875rem; font-family: inherit; color: var(--gray-500);
    border-radius: 0.5rem; transition: background .15s, color .15s;
}
.sidebar-foot button:hover { background: var(--red-50); color: var(--red-600); }
.sidebar-foot button svg { width: 1rem; height: 1rem; }

.main { flex: 1; display: flex; flex-direction: column; }
.topbar {
    background: #fff; border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 { font-size: 1.125rem; font-weight: 600; color: var(--gray-900); margin: 0; }
.content { flex: 1; padding: 1.5rem; }

/* ---------- DASHBOARD ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 768px) { .stat-grid { grid-template-columns: 1fr; } }
.panel { background: #fff; border: 1px solid var(--gray-200); border-radius: 0.75rem; padding: 1.25rem; }
.panel-lg { padding: 1.5rem; }
.stat-label { font-size: 0.75rem; font-weight: 500; color: var(--gray-500); text-transform: uppercase; letter-spacing: .03em; margin: 0; }
.stat-value { font-size: 1.875rem; font-weight: 700; color: var(--gray-900); margin: 0.25rem 0 0; }
.space-y > * + * { margin-top: 1.5rem; }

.badge { display: inline-flex; align-items: center; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
.badge-yellow { background: var(--yellow-100); color: var(--yellow-800); }
.badge-blue   { background: var(--blue-100); color: var(--blue-800); }
.badge-green  { background: var(--green-100); color: var(--green-800); }
.badge-gray   { background: var(--gray-100); color: var(--gray-800); }
.badge-purple { background: var(--purple-100); color: var(--purple-700); }

.row-item { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--gray-100); }
.row-item:last-child { border-bottom: none; }
.row-item .t { font-size: 0.875rem; font-weight: 500; color: var(--gray-900); margin: 0; }
.row-item .d { font-size: 0.75rem; color: var(--gray-500); margin: 0; }
.empty { font-size: 0.875rem; color: var(--gray-400); text-align: center; padding: 1rem 0; }

/* ---------- 2FA CODE INPUT ---------- */
.code-input { text-align: center; letter-spacing: .3em; font-size: 1.125rem; font-family: ui-monospace, monospace; }

/* ---------- ICON CIRCLE (pending/submitted) ---------- */
.icon-circle { width: 4rem; height: 4rem; border-radius: 9999px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.icon-circle svg { width: 2rem; height: 2rem; }
.icon-circle.green { background: var(--green-100); color: var(--green-600); }
.icon-circle.yellow { background: var(--yellow-100); color: var(--yellow-600); }

/* ---------- CATALOG cu tree lateral ---------- */
.catalog-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 768px) { .catalog-layout { grid-template-columns: 1fr; } }

.cat-tree { background: #fff; border: 1px solid var(--gray-200); border-radius: .75rem; padding: .75rem; position: sticky; top: 1rem; }
.cat-tree-title { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-400); padding: .5rem .5rem .75rem; margin: 0; }
.cat-node { font-size: .875rem; }
.cat-node-row { display: flex; align-items: center; gap: .25rem; padding: .4rem .5rem; border-radius: .5rem; cursor: pointer; color: var(--gray-700); text-decoration: none; transition: background .12s; }
.cat-node-row:hover { background: var(--gray-100); }
.cat-node-row.active { background: var(--brand-light); color: var(--blue-700); font-weight: 600; }
.cat-node-row .toggle { width: 1rem; height: 1rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--gray-400); cursor: pointer; user-select: none; }
.cat-node-row .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-node-row .count { font-size: .7rem; color: var(--gray-400); background: var(--gray-100); padding: .05rem .4rem; border-radius: 9999px; }
.cat-node-row.active .count { background: #fff; }
.cat-children { margin-left: .9rem; border-left: 1px solid var(--gray-100); padding-left: .25rem; overflow: hidden; }
.cat-children.collapsed { display: none; }

/* breadcrumbs */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .8rem; color: var(--gray-500); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--brand); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .bc-sep { color: var(--gray-300); }

/* filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; align-items: center; }
.filter-bar input, .filter-bar select { padding: .45rem .6rem; font-size: .8rem; border: 1px solid var(--gray-300); border-radius: .5rem; }
.filter-bar input[type=text] { flex: 1; min-width: 160px; }

/* ---------- Tree categorii IN SIDEBAR (sub Catalog) ---------- */
.sidebar-cat-tree { margin: .25rem 0 .5rem .5rem; padding-left: .5rem; border-left: 1px solid var(--gray-100); }
.scat-node { font-size: .8rem; }
.scat-row { display: flex; align-items: center; gap: .15rem; padding: .3rem .4rem; border-radius: .4rem; color: var(--gray-600); transition: background .12s; }
.scat-row:hover { background: var(--gray-100); }
.scat-row.active { background: var(--brand-light); color: var(--blue-700); font-weight: 600; }
.scat-toggle { width: .9rem; flex-shrink: 0; cursor: pointer; color: var(--gray-400); user-select: none; font-size: .7rem; text-align: center; }
.scat-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
.scat-count { font-size: .65rem; color: var(--gray-400); }
.scat-children { margin-left: .6rem; border-left: 1px solid var(--gray-100); padding-left: .15rem; }
.scat-children.collapsed { display: none; }

/* ---------- Checkout wizard stepper ---------- */
.steps { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.5rem; max-width: 48rem; }
.step-item { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--gray-400); }
.step-item .num { width: 1.6rem; height: 1.6rem; border-radius: 9999px; background: var(--gray-200); color: var(--gray-500); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .8rem; }
.step-item.active .num { background: var(--brand); color: #fff; }
.step-item.done .num { background: var(--green-600); color: #fff; }
.step-item.active { color: var(--gray-900); font-weight: 600; }
.step-line { flex: 1; height: 1px; background: var(--gray-200); }

/* metode plata */
.pay-method { display: block; border: 2px solid var(--gray-200); border-radius: .75rem; padding: 1rem; margin-bottom: .75rem; cursor: pointer; transition: border-color .15s, background .15s; }
.pay-method:hover { border-color: var(--gray-300); }
.pay-method input { margin-right: .5rem; }
.pay-method.sel { border-color: var(--brand); background: var(--brand-light); }
.pay-method .pm-title { font-weight: 600; font-size: .9rem; }
.pay-method .pm-desc { font-size: .8rem; color: var(--gray-500); margin-top: .25rem; }

/* randuri comenzi colorate dupa plata */
.order-row.unpaid { border-left: 3px solid var(--red-600); }
.order-row.paid { border-left: 3px solid var(--green-600); }

/* ---------- Dashboard plan: gauge circular ---------- */
.plan-section { margin-top: 1.5rem; }
.plan-gauges { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: flex-start; }
.gauge { text-align: center; width: 200px; }
.gauge svg { transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: var(--gray-200); }
.gauge .fill { fill: none; stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.gauge .pct { font-size: 1.6rem; font-weight: 700; fill: var(--brand); transform: rotate(90deg); transform-origin: center; }
.gauge-label { font-size: .82rem; color: var(--blue-700); font-weight: 600; margin-top: .5rem; line-height: 1.3; }
.gauge-amount { font-size: .9rem; font-weight: 700; color: var(--gray-700); margin-top: .25rem; }
.plan-tiers { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.tier-chip { font-size: .78rem; padding: .35rem .7rem; border-radius: 9999px; background: var(--gray-100); color: var(--gray-600); }
.tier-chip.active { background: var(--brand); color: #fff; font-weight: 600; }

/* ---------- Register stepper cu nume ---------- */
.reg-stepper { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin-bottom: 1.5rem; }
.reg-step { display: flex; align-items: center; gap: .4rem; padding: .3rem .55rem; border-radius: 9999px; background: var(--gray-100); color: var(--gray-500); font-size: .8rem; }
.reg-step.active { background: var(--brand); color: #fff; font-weight: 600; }
.reg-step.done { background: var(--green-50, #f0fdf4); color: var(--green-600, #16a34a); }
.reg-step-num { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.08); font-size: .72rem; font-weight: 700; }
.reg-step.active .reg-step-num { background: rgba(255,255,255,.25); }
.reg-step-label { white-space: nowrap; }
.reg-step-sep { flex: 0 0 12px; height: 1px; background: var(--gray-200); }
@media (max-width: 640px) { .reg-step-label { display: none; } .reg-step-sep { flex-basis: 6px; } }
.opt-cards { display: grid; gap: .75rem; }
.opt-card { border: 2px solid var(--gray-200); border-radius: .75rem; padding: 1rem; cursor: pointer; transition: border-color .15s, background .15s; }
.opt-card:hover { border-color: var(--brand); }
.opt-card input { margin-right: .5rem; }
.opt-card.selected, .opt-card input:checked ~ * { }
.subtype-box { margin-top: .75rem; padding-left: 1.5rem; }

/* ---------- Type cards cu iconuri (pas 2) ---------- */
.type-card { display: flex; align-items: flex-start; gap: .85rem; }
.type-card input[type=radio] { margin-top: .25rem; flex-shrink: 0; }
.type-icon { flex-shrink: 0; width: 48px; height: 48px; border-radius: .6rem; background: var(--gray-100); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.type-card input:checked ~ .type-icon { background: var(--brand); color: #fff; }
.type-body { display: flex; flex-direction: column; }
.type-body strong { font-size: 1rem; }
.subtype-opt { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; cursor: pointer; color: var(--gray-700); }
.subtype-opt svg { color: var(--brand); flex-shrink: 0; }

/* ---------- Asterisc camp obligatoriu ---------- */
.req { color: var(--red-600, #dc2626); font-weight: 700; }
a.reg-step { text-decoration: none; cursor: pointer; }
a.reg-step:hover { filter: brightness(0.95); }

/* ── Modale portal (plata card / review comanda) ── */
.pf-modal { display:none; position:fixed; inset:0; background:rgba(15,23,42,.5); z-index:300; align-items:center; justify-content:center; padding:1rem; }
.pf-modal.open { display:flex; }
.pf-modal-box { background:#fff; border-radius:14px; max-width:520px; width:100%; max-height:88vh; overflow-y:auto; padding:1.5rem; position:relative; box-shadow:0 20px 50px rgba(15,23,42,.25); }
.pf-modal-box h3 { margin:0 0 .75rem; }
.pf-modal-close { position:absolute; top:.75rem; right:.75rem; background:#f1f5f9; border:none; width:32px; height:32px; border-radius:50%; cursor:pointer; }
.pf-modal-actions { display:flex; gap:.5rem; justify-content:flex-end; margin-top:1.25rem; }
.pf-review-item { border:1px solid var(--gray-100, #eef0f4); border-radius:10px; padding:1rem; margin-bottom:1rem; }
.pf-review-item-head { display:flex; align-items:center; gap:.6rem; margin-bottom:.6rem; }
.pf-review-item-head img { width:44px; height:44px; object-fit:cover; border-radius:8px; }
.pf-review-form { display:flex; flex-direction:column; gap:.5rem; }
.pf-review-form input, .pf-review-form textarea { padding:.5rem; border:1px solid var(--gray-200,#e2e8f0); border-radius:8px; font:inherit; font-size:.88rem; }
.pf-review-form .shop-rating-stars { display:inline-flex; flex-direction:row-reverse; gap:.1rem; }
.pf-review-form .shop-rating-stars input { display:none; }
.pf-review-form .shop-rating-stars label { font-size:1.5rem; color:#d1d5db; cursor:pointer; }
.pf-review-form .shop-rating-stars input:checked ~ label, .pf-review-form .shop-rating-stars label:hover, .pf-review-form .shop-rating-stars label:hover ~ label { color:#f59e0b; }
