/* Web UI Styles - CF Loader Website */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #0d1117;
    --bg-alt: #161b22;
    --fg: #e6edf3;
    --fg-muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --danger: #f85149;
    --success: #3fb950;
    --warning: #d29922;
    --border: #30363d;
    --card-bg: #161b22;
    --input-bg: #0d1117;
    --shadow: 0 8px 24px rgba(0,0,0,0.4);
    --radius: 8px;
    --radius-sm: 4px;
    --transition: 150ms ease;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
input, button, select, textarea {
    font-family: inherit; font-size: 14px;
}
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 20px;
}
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}
h1 { font-size: 28px; font-weight: 600; margin-bottom: 8px; text-align: center; }
.subtitle { color: var(--fg-muted); text-align: center; margin-bottom: 32px; }
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--fg); }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--fg);
    transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}
input::placeholder { color: var(--fg-muted); }
input[type="checkbox"] { width: auto; margin-right: 8px; }
.btn {
    width: 100%;
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #ff6b64; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #56d364; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.muted { color: var(--fg-muted); font-size: 13px; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--fg-muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-error { background: rgba(248, 81, 73, 0.15); border: 1px solid var(--danger); color: #ff9b96; }
.alert-success { background: rgba(63, 185, 80, 0.15); border: 1px solid var(--success); color: #7ee787; }
.alert-warning { background: rgba(210, 153, 34, 0.15); border: 1px solid var(--warning); color: #e3c16b; }
.alert-info { background: rgba(88, 166, 255, 0.15); border: 1px solid var(--accent); color: #a5d6ff; }
.footer-links { display: flex; justify-content: center; gap: 24px; margin-top: 32px; font-size: 13px; color: var(--fg-muted); }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-active { background: rgba(63, 185, 80, 0.2); color: var(--success); }
.badge-expired { background: rgba(248, 81, 73, 0.2); color: var(--danger); }
.badge-lifetime { background: rgba(88, 166, 255, 0.2); color: var(--accent); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--fg-muted); font-weight: 600; text-transform: uppercase; font-size: 11px; }
.table tr:hover { background: rgba(255,255,255,0.02); }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab { padding: 10px 16px; border: none; background: transparent; color: var(--fg-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; transition: color var(--transition), border-color var(--transition); }
.tab:hover { color: var(--fg); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    min-width: 280px;
    max-width: 400px;
}
.toast-item {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-top: 8px;
    box-shadow: var(--shadow);
    animation: slideIn 300ms ease;
    background: var(--card-bg);
    border: 1px solid var(--border);
}
.toast-item.error { border-left: 4px solid var(--danger); }
.toast-item.success { border-left: 4px solid var(--success); }
.toast-item.warning { border-left: 4px solid var(--warning); }
.toast-item.info { border-left: 4px solid var(--accent); }
@keyframes slideIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.loading { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 800ms linear infinite; margin-right: 8px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.navbar {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-brand { font-weight: 700; font-size: 18px; color: var(--accent); }
.navbar-nav { display: flex; gap: 24px; }
.nav-link { color: var(--fg-muted); font-weight: 500; padding: 8px 0; }
.nav-link:hover, .nav-link.active { color: var(--accent); }
.page-header { padding: 40px 24px; text-align: center; }
.page-header h1 { font-size: 36px; margin-bottom: 12px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; padding: 0 24px 40px; max-width: 1200px; margin: 0 auto; }
.dashboard-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.dashboard-card h3 { font-size: 14px; color: var(--fg-muted); margin-bottom: 8px; }
.dashboard-card .value { font-size: 36px; font-weight: 700; color: var(--fg); }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; padding: 24px; max-width: 1200px; margin: 0 auto; }
.product-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; }
.product-card h3 { font-size: 18px; margin-bottom: 8px; }
.product-card .desc { color: var(--fg-muted); font-size: 14px; margin-bottom: 16px; flex: 1; }
.product-card .meta { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; font-size: 12px; }
.product-card .btn { margin-top: auto; }

/* Dashboard specific */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .label { font-size: 13px; color: var(--fg-muted); margin-bottom: 4px; }
.stat-card .number { font-size: 28px; font-weight: 700; }
.license-row { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.license-info { flex: 1; }
.license-info .title { font-weight: 600; margin-bottom: 4px; }
.license-info .sub { font-size: 13px; color: var(--fg-muted); }
.subscription-list { list-style: none; }
.subscription-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.subscription-info { flex: 1; }
.subscription-info .name { font-weight: 500; }
.subscription-info .cat { font-size: 12px; color: var(--fg-muted); }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; color: #fff; margin: 0 auto 16px; }

@media (max-width: 640px) {
    .container { padding: 24px 16px; }
    .card { padding: 24px; }
    .navbar { flex-direction: column; gap: 12px; }
    .navbar-nav { width: 100%; justify-content: center; flex-wrap: wrap; }
}