/* ================================================================
 * License System · Warm Minimal Theme v6.0
 * Design: Light, editorial, crafted — not AI-generated
 * Palette: Warm off-white surfaces, charcoal text, single accent
 * Fonts: Bricolage Grotesque (display) + Hanken Grotesk (body)
 * ================================================================ */

/* ========== Design Tokens ========== */
:root {
    /* Surfaces — warm, not gray */
    --bg:            #FAFAF8;
    --bg2:           #FFFFFF;
    --bg3:           #F5F4F2;
    --surface:       #FFFFFF;
    --surface-hover: #F5F4F2;

    /* Text — warm charcoal */
    --ink:           #1C1917;
    --muted:         #78716C;
    --muted2:        #A8A29E;

    /* Borders — warm light gray */
    --rule:          #E7E5E4;
    --rule-strong:   #D6D3D1;

    /* Accent — single restrained indigo */
    --accent:        #4338CA;
    --accent-hover:  #3730A3;
    --accent-light:  #EEF2FF;

    /* Primary action — near-black, minimalist */
    --btn-primary:        #1C1917;
    --btn-primary-hover:  #292524;

    /* Status */
    --success:       #15803D;
    --success-bg:    #F0FDF4;
    --success-border:#BBF7D0;
    --warning:       #B45309;
    --warning-bg:    #FFFBEB;
    --warning-border:#FDE68A;
    --danger:        #B91C1C;
    --danger-bg:     #FEF2F2;
    --danger-border: #FECACA;

    /* Radius */
    --radius:        10px;
    --radius-sm:     6px;
    --radius-lg:     14px;

    /* Shadow — subtle, layered */
    --shadow-xs: 0 1px 2px rgba(28,25,23,0.04);
    --shadow-sm: 0 1px 3px rgba(28,25,23,0.06), 0 1px 2px rgba(28,25,23,0.04);
    --shadow-md: 0 4px 12px rgba(28,25,23,0.08), 0 1px 3px rgba(28,25,23,0.04);
    --shadow-lg: 0 12px 32px rgba(28,25,23,0.10), 0 4px 12px rgba(28,25,23,0.06);

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

/* ========== Reset ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }
* { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }

/* ========== Selection ========== */
::selection { background: var(--accent-light); color: var(--accent); }

/* ========== Layout ========== */
.container {
    position: relative; z-index: 2;
    max-width: 960px; margin: 0 auto; padding: 0 24px;
}

/* ========== Navbar ========== */
.navbar {
    position: relative; z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
    padding: 14px 24px;
}
.navbar-inner {
    max-width: 960px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 17px; font-weight: 700; color: var(--ink);
    text-decoration: none; display: flex; align-items: center; gap: 8px;
    letter-spacing: -0.02em;
}
.navbar-brand .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
}
.navbar-links { display: flex; gap: 4px; align-items: center; }
.navbar-links a {
    color: var(--muted); text-decoration: none; font-size: 14px;
    font-weight: 500; padding: 7px 14px; border-radius: var(--radius-sm);
    transition: all 0.15s var(--ease);
}
.navbar-links a:hover { color: var(--ink); background: var(--bg3); }
.navbar-links a.active { color: var(--ink); background: var(--bg3); font-weight: 600; }
.navbar-links .btn-sm {
    background: var(--btn-primary); color: #FFF;
    padding: 7px 16px; border-radius: var(--radius-sm); font-weight: 600;
}
.navbar-links .btn-sm:hover { background: var(--btn-primary-hover); color: #FFF; }

/* ========== Page Header ========== */
.page-header { text-align: center; padding: 56px 24px 36px; }
.page-header h1 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 34px; font-weight: 700; color: var(--ink);
    margin-bottom: 10px; letter-spacing: -0.03em; line-height: 1.15;
}
.page-header .subtitle { font-size: 15px; color: var(--muted); }

/* ========== Forms ========== */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--ink); margin-bottom: 7px; letter-spacing: -0.01em;
}
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 11px 14px;
    background: var(--bg2); border: 1px solid var(--rule);
    border-radius: var(--radius-sm); color: var(--ink); font-size: 14px;
    font-family: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.form-input::placeholder { color: var(--muted2); }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-hint { font-size: 12px; color: var(--muted2); margin-top: 6px; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 6px; }

/* ========== Buttons ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 22px; border: 1px solid transparent; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.15s var(--ease); text-decoration: none; font-family: inherit;
    letter-spacing: -0.01em;
}
.btn-primary {
    background: var(--btn-primary); color: #FFF;
}
.btn-primary:hover { background: var(--btn-primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-secondary {
    background: var(--bg2); color: var(--ink); border: 1px solid var(--rule);
}
.btn-secondary:hover { background: var(--bg3); border-color: var(--rule-strong); }
.btn-success { background: var(--success); color: #FFF; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: #FFF; }
.btn-danger:hover { opacity: 0.9; }
.btn-warning { background: var(--warning); color: #FFF; }
.btn-warning:hover { opacity: 0.9; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ========== Cards ========== */
.card {
    background: var(--bg2); border: 1px solid var(--rule);
    border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow-xs); transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-sm); }
.card-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 17px; font-weight: 700; color: var(--ink);
    margin-bottom: 12px; letter-spacing: -0.02em;
}

/* ========== Card Grid ========== */
.card-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px; margin: 24px 0;
}

/* ========== Product Cards ========== */
.product-card {
    background: var(--bg2); border: 1px solid var(--rule);
    border-radius: var(--radius); padding: 28px; position: relative;
    box-shadow: var(--shadow-xs); transition: all 0.25s var(--ease-out);
}
.product-card:hover {
    border-color: var(--rule-strong); transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.product-card.featured {
    border-color: var(--ink);
    box-shadow: 0 0 0 1px var(--ink), var(--shadow-sm);
}
.product-card .badge {
    position: absolute; top: -10px; right: 20px;
    background: var(--ink); color: #FFF;
    font-size: 11px; font-weight: 700;
    padding: 4px 12px; border-radius: 100px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.product-card .price {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 38px; font-weight: 700; color: var(--ink);
    margin: 16px 0 4px; letter-spacing: -0.03em;
}
.product-card .price .unit { font-size: 16px; color: var(--muted); font-weight: 400; }
.product-card .duration { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.product-card .features { list-style: none; margin: 20px 0; }
.product-card .features li {
    color: var(--muted); font-size: 14px; padding: 6px 0;
    display: flex; align-items: center; gap: 8px;
}
.product-card .features li::before {
    content: ''; width: 14px; height: 14px; flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2315803D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: contain; background-repeat: no-repeat;
}

/* ========== Tables ========== */
.table-wrap {
    overflow-x: auto; border-radius: var(--radius);
    border: 1px solid var(--rule); margin: 16px 0;
    background: var(--bg2);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    background: var(--bg3); padding: 11px 16px; text-align: left;
    font-weight: 600; color: var(--muted); font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom: 1px solid var(--rule); white-space: nowrap;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--rule); color: var(--ink); }
tbody tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }

/* ========== Tags ========== */
.tag {
    display: inline-block; padding: 2px 10px; border-radius: 4px;
    font-size: 12px; font-weight: 600;
}
.tag-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.tag-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.tag-danger  { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.tag-muted   { background: var(--bg3); color: var(--muted); }

/* ========== Status Badges ========== */
.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 100px;
    font-size: 12px; font-weight: 600;
}
.status-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.status-valid   { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.status-valid .dot { background: var(--success); }
.status-expired { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.status-expired .dot { background: var(--warning); }
.status-disabled{ background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.status-disabled .dot { background: var(--danger); }
.status-pending { background: var(--bg3); color: var(--muted); }
.status-pending .dot { background: var(--muted2); }

/* ========== Alerts ========== */
.alert {
    padding: 13px 16px; border-radius: var(--radius-sm);
    margin-bottom: 16px; font-size: 14px; line-height: 1.5;
    border: 1px solid var(--rule);
}
.alert-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.alert-danger  { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.alert-info    { background: var(--bg3); color: var(--muted); }

/* ========== Modal ========== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(28, 25, 23, 0.4); backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; opacity: 0; visibility: hidden; transition: all 0.2s var(--ease);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg2); border: 1px solid var(--rule);
    border-radius: var(--radius-lg); padding: 28px;
    max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(16px) scale(0.98); transition: transform 0.2s var(--ease-out);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 20px; font-weight: 700; color: var(--ink);
    margin-bottom: 16px; letter-spacing: -0.02em;
}
.modal-close {
    float: right; cursor: pointer; color: var(--muted2);
    font-size: 22px; line-height: 1; background: none; border: none;
    padding: 0; transition: color 0.15s;
}
.modal-close:hover { color: var(--ink); }

/* ========== QR Code ========== */
.qrcode-container {
    display: flex; flex-direction: column; align-items: center;
    padding: 20px; gap: 12px;
}
.qrcode-container canvas, .qrcode-container img {
    border-radius: var(--radius-sm); background: white; padding: 12px;
    border: 1px solid var(--rule);
}
.qrcode-tip { font-size: 13px; color: var(--muted); text-align: center; }

/* ========== License Key Box ========== */
.license-key-box {
    background: var(--bg3); border: 1px solid var(--rule);
    border-radius: var(--radius-sm); padding: 14px;
    font-family: 'JetBrains Mono', monospace; font-size: 13px;
    color: var(--accent); word-break: break-all;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin: 12px 0;
}
.copy-btn {
    background: var(--bg2); border: 1px solid var(--rule);
    color: var(--muted); padding: 6px 12px; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 12px; white-space: nowrap;
    transition: all 0.15s; font-family: inherit; font-weight: 500;
}
.copy-btn:hover { color: var(--ink); border-color: var(--rule-strong); background: var(--bg3); }

/* ========== Tabs ========== */
.tabs {
    display: flex; gap: 2px; border-bottom: 1px solid var(--rule);
    margin-bottom: 24px; overflow-x: auto;
}
.tab {
    padding: 11px 18px; color: var(--muted); cursor: pointer;
    font-size: 14px; font-weight: 500; white-space: nowrap;
    border-bottom: 2px solid transparent; transition: all 0.15s var(--ease);
    background: none; border-top: none; border-left: none; border-right: none;
    font-family: inherit;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

/* ========== Empty State ========== */
.empty-state {
    text-align: center; padding: 56px 24px; color: var(--muted);
}
.empty-state .icon { font-size: 40px; margin-bottom: 16px; opacity: 0.3; }
.empty-state .title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px;
}
.empty-state .desc { font-size: 14px; color: var(--muted2); }
.empty-state a { color: var(--accent); font-weight: 600; text-decoration: none; }
.empty-state a:hover { text-decoration: underline; }

/* ========== Animations ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Background Utilities (Warm Minimal) ========== */
.bg-gradient {
    position: fixed; inset: 0; z-index: 0;
    background: var(--bg);
}
.noise {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    opacity: 0;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .page-header h1 { font-size: 26px; }
    .card-grid { grid-template-columns: 1fr; }
    .navbar-links { gap: 2px; }
    .navbar-links a { padding: 6px 10px; font-size: 13px; }
    .container { padding: 0 16px; }
    .page-header { padding: 36px 16px 24px; }
}
