/* IMPORT DES POLICES GOOGLE FONTS MODERNES */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #771141;
    --secondary-color: #540d2f;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-gray: #f5f5f5;
    --dark-gray: #333;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.2);
    
    /* Polices */
    --font-primary: 'Space Grotesk', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    --font-display: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-primary);
    background-color: var(--light-gray);
    color: var(--dark-gray);
    line-height: 1.6;
    letter-spacing: -0.3px;
}

/* ===== TYPOGRAPHIE ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.8px;
    background-color: #303031;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.6px;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

p {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.2px;
}

label {
    font-family: var(--font-secondary);
    font-weight: 600;
    color: #333;
}

input, textarea, select {
    font-family: var(--font-primary);
    font-weight: 500;
}

small, .text-muted {
    font-family: var(--font-secondary);
    font-size: 0.875rem;
    letter-spacing: -0.2px;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 80%;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 500px;
}

.main-container {
    min-height: calc(100vh - 80px);
    padding: 10px 0;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    font-family: var(--font-display);
}

.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.balance-header {
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-family: var(--font-secondary);
}

.user-name {
    font-weight: 500;
    font-family: var(--font-secondary);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    font-family: var(--font-primary);
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: #666;
    color: white;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
}

.btn:disabled,
.action-btn-disabled {
    background-color: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* ===== FORMS ===== */
.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row,
.form-row-3 {
    display: grid;
    gap: 20px;
}

.form-row {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.form-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
    .form-row-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

input,
textarea,
select {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

small {
    font-size: 12px;
    color: #999;
}

/* ===== FILE INPUT ===== */
.file-input {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.file-input input[type="file"] {
    position: absolute;
    left: -9999px;
}

.file-label {
    display: block;
    padding: 20px;
    background-color: #f0f0f0;
    border: 2px dashed var(--primary-color);
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s;
    user-select: none;
    font-family: var(--font-primary);
}

.file-input:hover .file-label,
.file-input input[type="file"]:focus ~ .file-label {
    background-color: rgba(102, 126, 234, 0.1);
    border-color: var(--secondary-color);
}

/* ===== INPUT WITH SUFFIX ===== */
.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-suffix input {
    flex: 1;
    margin: 0;
}

.input-suffix {
    position: absolute;
    right: 15px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.card-header {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 15px;
}

.card-header h2,
.card-header h3 {
    display: flex;
    margin-bottom: 5px;
    justify-content: space-between;
    font-family: var(--font-display);
}

.card-header p {
    color: #999;
    font-size: 14px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid;
    font-family: var(--font-secondary);
}

.alert-error {
    background-color: #fadbd8;
    color: #c0392b;
    border-left-color: var(--danger-color);
}

.alert-success {
    background-color: #d5f4e6;
    color: #27ae60;
    border-left-color: var(--success-color);
}

.alert-warning {
    background-color: #fdebd0;
    color: #e67e22;
    border-left-color: var(--warning-color);
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-secondary);
}

.badge-success {
    background-color: #d5f4e6;
    color: #27ae60;
}

.badge-warning {
    background-color: #fdebd0;
    color: #e67e22;
}

.badge-info {
    background-color: #d6eaf8;
    color: #3498db;
}

.badge-error {
    background-color: #fadbd8;
    color: #c0392b;
}

.badge-admin {
    background-color: #fadbd8;
    color: #e74c3c;
}

/* ===== GRID ===== */
.grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ===== TABS ===== */
.tabs-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #999;
    transition: all 0.3s;
    font-family: var(--font-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.05);
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== AUTH CONTAINER ===== */
.auth-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    
    width: 50%;
    max-width: 90%;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.auth-header p {
    color: #999;
    font-size: 14px;
    font-family: var(--font-secondary);
}

/* ===== DASHBOARD ===== */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    margin-bottom: 30px;
}

.welcome-card .card-header {
    border-bottom-color: rgba(255,255,255,0.2);
}

.welcome-card h2 {
    color: white;
    background: none;
    -webkit-text-fill-color: white;
}

.balance-card,
.info-card {
    position: relative;
}

.balance-display {
    margin: 20px 0;
}

.amount {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-family: var(--font-display);
}

.currency {
    font-size: 14px;
    color: #999;
    font-family: var(--font-secondary);
}

.text-muted {
    color: #999;
    font-size: 14px;
}

/* ===== ACTIONS GRID ===== */
.actions-grid,
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.action-btn,
.admin-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background-color: #f9f9f9;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: var(--dark-gray);
    transition: all 0.3s;
    position: relative;
    font-family: var(--font-primary);
}

.action-btn:hover,
.admin-action:hover {
    border-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.action-icon,
.admin-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.action-label,
.admin-label {
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    margin-bottom: 5px;
    font-family: var(--font-display);
}

.action-arrow,
.admin-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 20px;
}

.action-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: transparent;
}

.action-note {
    font-size: 12px;
    color: #999;
    font-family: var(--font-secondary);
}

/* ===== PROFILE ===== */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.profile-item {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.profile-item label {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
    font-family: var(--font-secondary);
}

.profile-item p {
    font-weight: 500;
    color: var(--dark-gray);
}

/* ===== DOCUMENTS ===== */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.document-item {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    text-align: center;
}

.document-item h3 {
    margin-bottom: 15px;
    font-size: 14px;
    font-family: var(--font-display);
}

/* ===== BALANCE INFO ===== */
.balance-info {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
}

.balance-info p:first-child {
    color: #558b2f;
    font-size: 14px;
    margin-bottom: 10px;
    font-family: var(--font-secondary);
}

.balance-text {
    font-size: 28px;
    font-weight: bold;
    color: #27ae60;
    font-family: var(--font-display);
}

/* ===== LOADING ===== */
.loading-container {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.countdown {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 20px;
    font-family: var(--font-display);
}

/* ===== PROGRESS ===== */
.progress-section {
    margin: 30px 0;
}

.progress-container {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: width 0.5s ease;
}

.progress-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.progress-step {
    text-align: center;
    padding: 15px;
    background-color: white;
    border-radius: 5px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
    font-family: var(--font-primary);
}

.progress-step.completed {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.progress-step.completed .step-number,
.progress-step.completed .step-label {
    color: white;
}

.step-number {
    display: block;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-family: var(--font-display);
}

.step-label {
    display: block;
    font-size: 12px;
    color: #999;
    font-family: var(--font-secondary);
}

/* ===== STEP MESSAGE ===== */
.step-message {
    background-color: #e3f2fd;
    padding: 15px;
    border-left: 4px solid var(--info-color);
    border-radius: 5px;
    margin-bottom: 20px;
    font-family: var(--font-secondary);
}

.step-message p {
    margin: 5px 0;
}

.step-message strong {
    color: var(--info-color);
}

/* ===== SUCCESS/ERROR ===== */
.success-container,
.error-container {
    text-align: center;
    padding: 40px 20px;
}

.success-icon,
.error-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.success-icon {
    color: var(--success-color);
}

.error-icon {
    color: var(--danger-color);
}

.transfer-details {
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-primary);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item span:first-child {
    font-weight: 600;
    color: #999;
}

/* ===== ADMIN STYLES ===== */
.admin-info {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-primary);
}

.info-row:last-child {
    border-bottom: none;
}

.label {
    font-weight: 600;
    color: #666;
    font-family: var(--font-secondary);
}

.value {
    color: var(--dark-gray);
}

/* ===== STATS CARD ===== */
.stat-card {
    display: flex;
    gap: 20px;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.stat-blue {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.stat-green {
    background-color: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.stat-orange {
    background-color: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

.stat-red {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.stat-success {
    background-color: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: var(--dark-gray);
    font-family: var(--font-display);
}

.stat-label {
    font-size: 14px;
    color: #999;
    font-family: var(--font-secondary);
}

/* ===== TABLE ===== */
.table-responsive {
    overflow-x: auto;
    margin: -25px -25px 0 -25px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-primary);
}

.table thead {
    background-color: #f9f9f9;
    border-bottom: 2px solid var(--border-color);
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    font-family: var(--font-secondary);
}

.table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: #f9f9f9;
}

/* ===== FILTER TABS ===== */
.filter-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 10px 20px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--dark-gray);
    font-family: var(--font-primary);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ===== INFO LIST ===== */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    justify-content: space-between 10px;
    align-items: center;
    padding: 0.2rem;
    font-family: var(--font-primary);
}

.info-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
    font-family: var(--font-secondary);
}

.info-value {
    color: var(--dark-gray);
    font-weight: 500;
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}

.status-badge {
    display: inline-block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .grid-4,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .progress-steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .actions-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 0;
    font-family: var(--font-primary);
}

.step-loader {
    text-align: center;
    padding: 30px 0;
}

.logo img {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .logo span {
        display: none; /* Cache le texte sur petit mobile pour laisser place à l'image */
    }
}



/* BARRE DE NAVIGATION BASSE (Uniquement sur Mobile) */
@media (max-width: 768px) {
    .tabs-navigation {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        display: flex;
        justify-content: space-around;
        padding: 10px 0;
        box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
        z-index: 1000;
        border-top: 1px solid #eee;
    }

    .tab-btn {
        font-size: 10px;
        flex-direction: column;
        gap: 5px;
        border: none !important;
        background: none !important;
        color: #8e8e93 !important;
    }

    .tab-btn.active {
        color: var(--primary-color) !important;
    }

    /* On ajoute de l'espace en bas pour ne pas cacher le contenu */
    body { padding-bottom: 80px; }
    
    /* On cache le header sur mobile pour gagner de la place */
    .header { padding: 10px 0; }
    .logo span { font-size: 18px; }
}