:root {
    --bg-color: #121212;
    --card-bg: rgba(25, 25, 25, 0.6);
    --card-border: rgba(197, 160, 89, 0.2);
    --gold: #c5a059;
    --gold-hover: #e0b666;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --error: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(197, 160, 89, 0.1) 0%, rgba(18, 18, 18, 0) 70%);
}

.view {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.view.active {
    display: flex;
    opacity: 1;
}

/* Glassmorphism */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* Login View */
#login-view {
    justify-content: center;
    align-items: center;
}

.login-card {
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.logo-container {
    margin-bottom: 30px;
}

.logo-img {
    max-width: 250px;
    height: auto;
    margin-bottom: 20px;
}

.logo-container h1 {
    font-weight: 400;
    font-size: 32px;
    letter-spacing: 4px;
    color: var(--gold);
    margin-bottom: 5px;
}

.tagline {
    font-size: 14px;
    color: var(--gold);
    opacity: 0.8;
}

.tagline span {
    font-weight: 600;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--gold);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--gold);
    color: #111;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    margin-top: 10px;
}

.btn-primary:hover {
    background: var(--gold-hover);
}

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

.error-msg {
    color: var(--error);
    font-size: 14px;
    min-height: 20px;
    margin-bottom: 15px;
}

/* Dashboard View */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid var(--card-border);
}

.header-logo {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--gold);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

.dashboard-content {
    flex: 1;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    margin-bottom: 40px;
}

.section-title h2 {
    font-weight: 400;
    font-size: 28px;
    color: var(--gold);
    margin-bottom: 8px;
}

.section-title p {
    color: var(--text-muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.license-card {
    transition: transform 0.3s;
}

.license-card:hover {
    transform: translateY(-5px);
}

.card-header {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-header h3 {
    font-weight: 400;
    font-size: 20px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.badge.active { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.badge.lifetime { background: rgba(197, 160, 89, 0.2); color: var(--gold); }

.key-box {
    background: rgba(0,0,0,0.5);
    padding: 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    color: var(--gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
}
.copy-btn:hover { color: white; }

.download-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 10px;
    border-radius: 6px;
    transition: all 0.3s;
}

.download-btn:hover {
    background: var(--gold);
    color: #000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(197, 160, 89, 0.3);
    border-radius: 50%;
    border-top-color: var(--gold);
    animation: spin 1s ease-in-out infinite;
    margin: 40px auto;
}

.hidden { display: none !important; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- ADMIN PANEL --- */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    text-align: center;
    padding: 20px;
}
.stat-value {
    font-size: 36px;
    color: var(--gold);
    font-weight: 600;
    margin-top: 10px;
}
.admin-tools {
    margin-bottom: 20px;
}
.search-input {
    width: 100%;
    padding: 12px 20px;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    outline: none;
}
.search-input:focus {
    border-color: var(--gold);
}
.table-container {
    overflow-x: auto;
    padding: 20px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.admin-table th, .admin-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}
.admin-table th:hover {
    color: var(--gold);
}
.btn-action {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.btn-action:hover {
    background: rgba(255,255,255,0.1);
}

/* Fix select dropdown options lisibilite */
.admin-tools .btn-primary,
#create-license-panel .btn-primary,
#renew-modal .btn-primary {
    width: auto;
    margin-top: 0;
}

/* --- HOW TO USE (MODE D'EMPLOI) --- */
.htu-section {
    margin-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 15px;
}

.htu-toggle {
    display: block;
    width: 100%;
    text-align: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
}

.htu-toggle:hover {
    background: var(--gold);
    color: #000;
}

.htu-content {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.05);
    font-size: 14px;
    color: #ddd;
    line-height: 1.5;
}

.htu-block {
    margin-bottom: 20px;
}

.htu-block:last-child {
    margin-bottom: 0;
}

.htu-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
    padding-bottom: 5px;
}

.htu-step-title {
    font-weight: 600;
    color: #fff;
    margin-top: 10px;
    margin-bottom: 5px;
}

.htu-steps {
    list-style-position: outside;
    margin-left: 20px;
}

.htu-steps li {
    margin-bottom: 8px;
}

.htu-sub {
    display: block;
    font-size: 13px;
    color: #aaa;
    margin-top: 2px;
}

.htu-path {
    display: inline-block;
    background: rgba(0,0,0,0.5);
    color: var(--gold);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    margin-top: 4px;
    word-break: break-all;
}

select.search-input {
    background: #1e1e2e;
    color: white;
    cursor: pointer;
}

select.search-input option {
    background: #1e1e2e;
    color: white;
}

.admin-tools {
    display: flex;
    align-items: center;
}
