/* --- Styles globaux & Variables --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f8fafc;
    color: #1e293b;
}

/* --- Pages d'authentification (Signin / Verify / Autosign) --- */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #fdfdfd;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.logo-box {
    width: 80px;
    height: 80px;
    background: #6366f1;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    color: #111827;
    margin-bottom: 24px;
}

.input-container {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.input-container:focus-within {
    border-color: #6366f1;
}

.input-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.input-row {
    display: flex;
    align-items: center;
    position: relative;
}

.input-icon {
    color: #6366f1;
    font-size: 20px;
    margin-right: 10px;
}

.text-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #1e293b;
    background: transparent;
}

.right-action {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
}

.forgot-text {
    color: #6366f1;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.visibility-icon {
    color: #94a3b8;
    cursor: pointer;
    font-size: 20px;
}

.trusted-wrapper {
    margin: 16px 0;
}

.switch-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.switch-container input {
    margin-right: 8px;
    accent-color: #6366f1;
    width: 16px;
    height: 16px;
}

.submit-btn {
    width: 100%;
    background: #6366f1;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    transition: background 0.2s;
}

.submit-btn:disabled, .submit-btn.disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
}

.warning-text {
    font-size: 12px;
    color: #ef4444;
    text-align: center;
    margin-bottom: 12px;
    font-weight: 600;
}

.footer-text {
    text-align: center;
    font-size: 10px;
    color: #94a3b8;
    margin-top: 30px;
    line-height: 1.4;
}

/* Specific Verify */
.code-input {
    width: 100%;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: #111827;
    letter-spacing: 4px;
    outline: none;
}

.code-input:focus {
    border-color: #6366f1;
}

.link-text {
    color: #6366f1;
    font-weight: 700;
    text-decoration: none;
}

/* --- Espace Home (/home) --- */
.home-body {
    background-color: #f1f5f9;
    min-height: 100vh;
}

.home-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-title {
    font-weight: 800;
    font-size: 18px;
    color: #0f172a;
}

.logout-btn {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #fecaca;
}

.home-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
}

@media (max-width: 768px) {
    .home-container {
        grid-template-columns: 1fr;
    }
}

.card-block {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.block-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.block-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.block-content {
    font-size: 14px;
    color: #334155;
}

.loading-text, .empty-text {
    color: #94a3b8;
    font-style: italic;
}

/* Bloc 1 : Infos */
.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-list li {
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 8px;
}

/* Bloc 2 : Jetons */
.credits-display {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
}

.credits-label {
    font-weight: 600;
    color: #64748b;
}

.credits-number {
    font-size: 28px;
    font-weight: 800;
    color: #6366f1;
}

.section-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 10px;
}

.token-packs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.pack-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    color: #1e293b;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s;
}

.pack-btn:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

.price-tag {
    font-size: 12px;
    color: #6366f1;
    font-weight: 700;
}

.export-section {
    margin-top: 14px;
    text-align: right;
}

.text-link {
    color: #6366f1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
}

/* Bloc 3 : Abonnements */
.subs-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sub-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sub-card.active {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.sub-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 70%;
}

.sub-type-badge {
    display: inline-block;
    background: #e0e7ff;
    color: #4338ca;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.sub-desc {
    font-size: 12px;
    color: #64748b;
}

.sub-dates {
    font-size: 11px;
    color: #059669;
    font-weight: 600;
    margin-top: 4px;
}

.btn-subscribe {
    background: #6366f1;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-unsubscribe {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Bloc 4 : Factures */
.invoice-ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invoice-ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
}

.inv-date {
    color: #64748b;
}

.inv-ref {
    font-weight: 600;
}

.inv-amount {
    font-weight: 700;
    color: #0f172a;
}

.inv-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}

.inv-link:hover {
    text-decoration: underline;
}