* { box-sizing: border-box; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

:root {
    --bg: #0a0c13;
    --bg-soft: #111522;
    --card: rgba(255, 255, 255, 0.07);
    --card-strong: rgba(255, 255, 255, 0.1);
    --line: rgba(255, 255, 255, 0.09);
    --text: #f5f7fb;
    --muted: #b5bfd3;
    --accent: #9d1835;
    --accent-2: #e8b46f;
    --success-bg: rgba(34, 197, 94, 0.15);
    --success-text: #8ff0ab;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-text: #ffb2b2;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: radial-gradient(circle at top left, rgba(157, 24, 53, 0.25), transparent 32%),
                radial-gradient(circle at top right, rgba(232, 180, 111, 0.18), transparent 26%),
                linear-gradient(135deg, #080b12, #0d1220 55%, #090b11);
    color: var(--text);
    min-height: 100%;
}

body {
    position: relative;
}

.site-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
      radial-gradient(circle at 20% 20%, rgba(255,255,255,.06) 0, transparent 15%),
      radial-gradient(circle at 80% 10%, rgba(255,255,255,.04) 0, transparent 13%),
      radial-gradient(circle at 70% 60%, rgba(232,180,111,.05) 0, transparent 18%);
    z-index: 0;
}

a { color: inherit; text-decoration: none; }

.container {
    width: min(1180px, calc(100% - 24px));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.page {
    padding: 24px 0 40px;
    position: relative;
    z-index: 1;
}

.topbar,
.scan-topbar {
    position: relative;
    z-index: 1;
    backdrop-filter: blur(12px);
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
    border-bottom: 1px solid var(--line);
}

.topbar-inner,
.scan-topbar-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), #5f1121);
    display: grid;
    place-items: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 8px 20px rgba(157, 24, 53, .4);
}

.brand-title,
.scan-brand {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .3px;
}

.brand-subtitle,
.scan-sub {
    color: var(--muted);
    font-size: 13px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-pill {
    background: rgba(255,255,255,.08);
    border: 1px solid var(--line);
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--muted);
}

.nav-wrap {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
    background: rgba(10, 12, 19, 0.5);
    border-bottom: 1px solid var(--line);
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 0;
}

.nav-links a {
    background: rgba(255,255,255,.06);
    border: 1px solid var(--line);
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--text);
    transition: .18s ease;
}

.nav-links a:hover {
    background: rgba(255,255,255,.12);
    transform: translateY(-1px);
}

.card,
.hero-card,
.stat-card,
.login-panel,
.scan-hero {
    background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.card {
    padding: 20px;
    margin-bottom: 18px;
}

.table-card { padding: 12px; }

.hero-card {
    overflow: hidden;
    position: relative;
    padding: 28px;
    margin-bottom: 18px;
    min-height: 220px;
}

.hero-card h1,
.scan-hero h1 {
    font-size: clamp(28px, 4vw, 42px);
    margin: 8px 0 12px;
    line-height: 1.08;
}

.hero-card p,
.scan-hero p {
    color: var(--muted);
    max-width: 720px;
    line-height: 1.6;
}

.hero-glow {
    position: absolute;
    width: 260px;
    height: 260px;
    right: -40px;
    top: -40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,180,111,.55), transparent 62%);
    filter: blur(12px);
    opacity: .6;
}

.eyebrow {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(232, 180, 111, .12);
    color: #ffd7a6;
    border: 1px solid rgba(232, 180, 111, .16);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: .12em;
}

.stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.stat-card {
    padding: 20px;
}

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

.stat-value {
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 800;
    margin-top: 8px;
}

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

.section-head h2 {
    margin: 0;
    font-size: 22px;
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.3), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn:hover::before {
    opacity: 1;
}

.btn:hover {
    transform: translateY(-2px);
}

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

.btn-block { width: 100%; }
.btn-sm { padding: 10px 14px; font-size: 14px; }

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #7b132b);
    box-shadow: 0 12px 28px rgba(157, 24, 53, 0.45), inset 0 1px 8px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    box-shadow: 0 16px 36px rgba(157, 24, 53, 0.55), inset 0 1px 12px rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), inset 0 1px 8px rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), inset 0 1px 12px rgba(255, 255, 255, 0.08);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #c6253b, #9c1d2f);
}

.notice {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.notice-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: rgba(34,197,94,.2);
}

.notice-error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: rgba(239,68,68,.2);
}

.table-wrap {
    overflow-x: auto;
    border-radius: 18px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.table th, .table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.table th {
    color: #dbe4f7;
    font-size: 13px;
    letter-spacing: .03em;
    background: rgba(255,255,255,.02);
}

.preview-thumb {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    object-fit: cover;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--line);
}

.badge {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.form-group.full {
    grid-column: 1 / -1;
}

label {
    font-weight: 700;
    color: #eef2fb;
    font-size: 14px;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="file"],
select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
    color: var(--text);
    border-radius: 16px;
    outline: none;
}

select option {
    background: #1a1f30;
    color: #f5f7fb;
}

input::placeholder {
    color: #9aa7bf;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 18px;
}

.search-bar {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 220px auto;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-shell {
    width: min(480px, calc(100% - 24px));
    position: relative;
    z-index: 1;
}

.login-panel {
    padding: 28px;
}

.login-badge {
    display: inline-flex;
    padding: 8px 12px;
    background: rgba(232, 180, 111, .14);
    border: 1px solid rgba(232, 180, 111, .18);
    color: #ffd7a6;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .12em;
}

.login-panel h1 {
    margin: 16px 0 8px;
    font-size: 34px;
}

.login-subtitle,
.login-hint {
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.scan-page .page {
    padding-top: 18px;
}

.scan-layout {
    max-width: 1280px;
}

.scan-hero {
    margin-bottom: 18px;
    padding: 26px;
}

.scan-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(320px, .9fr);
    gap: 18px;
    align-items: start;
}

.scanner-panel {
    padding: 18px;
}

#reader {
    width: 100%;
    height: 100vh;
    max-height: calc(100vh - 120px);
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.03);
}

.scanner-reader {
    position: relative;
    width: 100%;
}

.manual-lookup {
    margin-top: 16px;
}

.manual-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 8px;
}

.premium-result {
    position: sticky;
    top: 96px;
}

.result-card {
    text-align: center;
}

.result-art-wrap {
    padding: 10px;
    border-radius: 28px;
    background: radial-gradient(circle at top, rgba(232,180,111,.14), rgba(255,255,255,.04));
    border: 1px solid var(--line);
    margin-bottom: 18px;
}

.result-card img {
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(0,0,0,.35);
    background: rgba(255,255,255,.05);
}

.product-name {
    font-size: clamp(24px, 3.2vw, 34px);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 10px;
}

.product-price {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 900;
    color: #ffd19a;
    text-shadow: 0 0 18px rgba(232,180,111,.18);
}

.product-meta {
    color: var(--muted);
    margin-top: 10px;
    line-height: 1.6;
}

code {
    background: rgba(255,255,255,.06);
    border: 1px solid var(--line);
    padding: 2px 8px;
    border-radius: 10px;
    color: #ffd7a6;
}

/* Change Password Form */
.form-wrapper {
    max-width: 480px;
    margin: 0 auto 40px;
}

.change-password-form {
    display: grid;
    gap: 18px;
}

.form-actions {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.form-hint {
    color: var(--muted);
    font-size: 12px;
    display: block;
    margin-top: 4px;
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .scan-grid {
        grid-template-columns: 1fr;
    }

    .premium-result {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .form-grid,
    .search-bar,
    .manual-row {
        grid-template-columns: 1fr;
    }

    .brand-title, .scan-brand {
        font-size: 18px;
    }

    .hero-card,
    .scan-hero,
    .card,
    .login-panel {
        border-radius: 20px;
        padding: 18px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-wrapper {
        margin-left: 0;
        margin-right: 0;
    }

    .table {
        min-width: 760px;
    }
}
