/* assets/css/style.css - Portail captif AZZERTEL */

:root {
    --primary: #5500a6;
    --primary-dark: #3b0075;
    --accent: #f4b000;
    --success: #15803d;
    --danger: #dc2626;
    --warning: #b45309;
    --ink: #172033;
    --muted: #657186;
    --line: #ded7ea;
    --surface: #ffffff;
    --soft: #f7f3fb;
    --dark-bg: #090411;
    --dark-panel: #13081f;
}

.access-code,
.access-code-display {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    letter-spacing: 0;
}

.access-code-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 8.5rem;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(25, 135, 84, 0.35);
    border-radius: 8px;
    background: #ffffff;
    color: #146c43;
    font-size: 1.75rem;
    font-weight: 800;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--ink);
    background:
        radial-gradient(circle at top, rgba(85, 0, 166, 0.36), transparent 34rem),
        linear-gradient(180deg, #12051f 0%, var(--dark-bg) 100%);
}

.container {
    width: 100%;
    max-width: 1120px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 1rem;
    padding-left: 1rem;
}

.row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
    display: flex;
    flex-wrap: wrap;
    margin-top: calc(-1 * var(--bs-gutter-y));
    margin-right: calc(-0.5 * var(--bs-gutter-x));
    margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.row > * {
    width: 100%;
    max-width: 100%;
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    margin-top: var(--bs-gutter-y);
}

.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

.justify-content-center {
    justify-content: center;
}

.col-6 {
    flex: 0 0 auto;
    width: 50%;
}

.py-4 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 1rem;
}

.p-4 {
    padding: 1.5rem;
}

.p-5 {
    padding: 3rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.my-3 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.w-100 {
    width: 100%;
}

.d-block {
    display: block;
}

.d-inline-block {
    display: inline-block;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: flex-start;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--muted) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-white {
    color: #ffffff !important;
}

.small,
small {
    font-size: 0.875em;
}

.border,
.border-0,
.border-success {
    border: 1px solid var(--line);
}

.border-0 {
    border: 0 !important;
}

.border-success {
    border-color: rgba(21, 128, 61, 0.35) !important;
}

.rounded-3,
.rounded-4 {
    border-radius: 8px;
}

.overflow-hidden {
    overflow: hidden;
}

.shadow-sm {
    box-shadow: 0 4px 12px rgba(23, 32, 51, 0.08);
}

.shadow-lg {
    box-shadow: 0 16px 38px rgba(23, 32, 51, 0.10);
}

.bg-light {
    background: var(--soft) !important;
}

.bg-white {
    background: #ffffff !important;
}

.bg-success {
    background: var(--success) !important;
}

.bg-opacity-10 {
    --bs-bg-opacity: 0.10;
}

.bg-success.bg-opacity-10 {
    background: rgba(21, 128, 61, 0.10) !important;
}

.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-justified > .nav-item,
.nav-justified .nav-link {
    flex: 1 1 auto;
    text-align: center;
}

.nav-link {
    display: block;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.card-body {
    padding: 1rem;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    background: #ffffff;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #ffffff;
}

.btn-secondary {
    background: #475569;
    border-color: #475569;
    color: #ffffff;
}

.btn-sm {
    min-height: 34px;
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
}

.btn-close {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.btn-close::before {
    content: "x";
    color: var(--ink);
    font-size: 1.5rem;
    line-height: 1;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    max-width: min(500px, calc(100% - 1rem));
    margin: 1.75rem auto;
    pointer-events: none;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--line);
}

.modal-title {
    margin: 0;
}

.modal-body {
    padding: 1rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.55);
}

.modal-open {
    overflow: hidden;
}

.progress {
    display: flex;
    height: 1rem;
    overflow: hidden;
    background: #e5e7eb;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    transition: width 0.6s ease;
}

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: -0.125em;
    border: 0.18em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.bi {
    display: inline-block;
    width: 1em;
    min-width: 1em;
}

@media (min-width: 576px) {
    .col-sm-6 {
        flex: 0 0 auto;
        width: 50%;
    }
}

@media (min-width: 768px) {
    .col-md-10 {
        flex: 0 0 auto;
        width: 83.333333%;
    }
}

@media (min-width: 992px) {
    .col-lg-8 {
        flex: 0 0 auto;
        width: 66.666667%;
    }
}

.card,
.modal-content,
.form-control,
.form-select,
.btn,
.alert,
.dropdown-menu {
    border-radius: 8px !important;
}

.card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(222, 215, 234, 0.95) !important;
    box-shadow: 0 16px 38px rgba(23, 32, 51, 0.10) !important;
}

.card:hover {
    box-shadow: 0 18px 42px rgba(23, 32, 51, 0.13) !important;
}

.app-title {
    color: var(--primary);
    font-weight: 700;
}

.portal-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.25rem;
}

.portal-logo {
    display: block;
    width: auto;
    max-width: min(220px, 78%);
    max-height: 84px;
    object-fit: contain;
}

/* Navigation */
.nav-pills {
    gap: 0.35rem;
}

.nav-pills .nav-link {
    min-height: 44px;
    color: var(--ink);
    border-radius: 8px;
    padding: 0.62rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.nav-pills .nav-link:hover {
    background: rgba(85, 0, 166, 0.10);
}

.nav-pills .nav-link.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(85, 0, 166, 0.26);
}

#dashboardTabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
}

#dashboardTabs::-webkit-scrollbar {
    display: none;
}

#dashboardTabs .nav-item {
    flex: 1 1 0;
    min-width: 0;
}

#dashboardTabs .nav-link {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Boutons */
.btn {
    min-height: 40px;
    font-size: 0.92rem;
    font-weight: 700;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 10px 20px rgba(85, 0, 166, 0.24);
}

.btn-outline-primary {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: #ffffff;
}

.btn-outline-primary:hover,
.btn-outline-primary.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.btn-outline-danger {
    border-color: var(--danger);
    color: var(--danger);
}

/* Formulaires */
.form-label {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-control,
.form-select {
    border: 1px solid var(--line);
    padding: 0.66rem 0.9rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control-lg,
.form-select-lg,
.btn-lg {
    min-height: 44px;
    padding: 0.62rem 0.95rem;
    font-size: 0.98rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(85, 0, 166, 0.15);
}

/* Dashboard utilisateur */
.user-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.user-avatar-large i {
    color: #ffffff !important;
    font-size: 4rem !important;
}

.subscription-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: #ffffff;
    border-radius: 8px;
    padding: 2rem;
}

.countdown-timer {
    font-size: 1.65rem;
    font-weight: 700;
    text-align: center;
    margin: 0;
}

.bg-white.bg-opacity-10 {
    background-color: rgba(255, 255, 255, 0.12) !important;
}

.bg-white.bg-opacity-20 {
    background-color: rgba(255, 255, 255, 0.22) !important;
}

/* Catalogue */
.catalog-card .card-body {
    padding: clamp(1rem, 3vw, 1.75rem) !important;
}

.catalog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.catalog-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin-bottom: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    color: var(--primary-dark);
    background: rgba(85, 0, 166, 0.10);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.currency-switch {
    display: inline-flex;
    gap: 0.4rem;
    flex: 0 0 auto;
}

.currency-switch .btn {
    min-width: 70px;
}

.fees-note {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(217, 119, 6, 0.25);
    background: #fff8ed;
    color: #7c4a03;
    font-size: 0.92rem;
    line-height: 1.35;
}

.catalog-section {
    padding-top: 1rem;
}

.catalog-section + .catalog-section {
    margin-top: 1rem;
    border-top: 1px solid var(--line);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.section-title i {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(85, 0, 166, 0.10);
    color: var(--primary);
    font-size: 1.15rem;
}

.section-title h6 {
    margin: 0;
    font-weight: 800;
}

.section-title span {
    color: var(--muted);
    font-size: 0.88rem;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.9rem;
}

.equipment-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.plan-card-horizontal {
    min-width: 0;
}

.offer-card {
    min-height: 100%;
    padding: 1rem;
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.offer-card:hover {
    border-color: rgba(85, 0, 166, 0.55);
    box-shadow: 0 12px 24px rgba(23, 32, 51, 0.10);
    transform: translateY(-2px);
}

.equipment-offer {
    border-left: 4px solid var(--accent);
}

.offer-duration {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-bottom: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    color: var(--accent);
    background: rgba(217, 119, 6, 0.10);
    font-size: 0.78rem;
    font-weight: 800;
}

.plan-price {
    color: var(--primary);
    font-size: 1.45rem;
    font-weight: 800;
}

.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
}

.empty-state i {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 2.5rem;
    color: #9aa6b2;
}

/* Historique */
.transaction-list {
    scrollbar-width: thin;
}

.transaction-item {
    background: #ffffff;
    border-radius: 8px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.transaction-item:hover {
    background: var(--soft);
    box-shadow: 0 6px 16px rgba(23, 32, 51, 0.08);
}

.transaction-item.success {
    border-left-color: var(--success) !important;
}

.transaction-item.pending {
    border-left-color: var(--warning) !important;
}

.transaction-item.failed {
    border-left-color: var(--danger) !important;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-badge.success {
    background: #dcfce7;
    color: #14532d;
}

.status-badge.pending {
    background: #fef3c7;
    color: #78350f;
}

.status-badge.failed {
    background: #fee2e2;
    color: #7f1d1d;
}

/* Modal de paiement */
#payment-step-2 .progress {
    height: 10px;
    border-radius: 999px;
}

#payment-step-2 .progress-bar {
    background: var(--primary);
}

#payment-timer {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.9rem;
}

/* Notifications */
.alert {
    border: 1px solid transparent;
    padding: 0.9rem 1rem;
}

.alert-success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #14532d;
}

.alert-danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #7f1d1d;
}

.alert-info {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #075985;
}

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

@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.35s ease;
}

.slide-in,
.alert {
    animation: slideIn 0.25s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #edf2f7;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 86px;
        background:
            radial-gradient(circle at top, rgba(85, 0, 166, 0.34), transparent 24rem),
            #090411;
    }

    .container {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .card-body.p-5 {
        padding: 1.35rem !important;
    }

    .portal-logo {
        max-width: min(190px, 82%);
        max-height: 72px;
    }

    .catalog-header {
        flex-direction: column;
        align-items: stretch;
    }

    .currency-switch {
        width: 100%;
    }

    .currency-switch .btn {
        flex: 1;
    }

    .catalog-grid,
    .equipment-grid {
        grid-template-columns: 1fr;
    }

    .countdown-timer {
        font-size: 1.28rem;
    }

    .user-avatar-large {
        width: 72px;
        height: 72px;
    }

    .user-avatar-large i {
        font-size: 3rem !important;
    }

    #dashboardTabs {
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        bottom: max(0.75rem, env(safe-area-inset-bottom));
        z-index: 1050;
        margin: 0 !important;
        padding: 0.45rem !important;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: rgba(18, 5, 31, 0.94) !important;
        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42) !important;
        backdrop-filter: blur(14px);
        overflow: visible;
    }

    #dashboardTabs .nav-item {
        flex: 1 1 0;
        min-width: 0;
    }

    #dashboardTabs .nav-link {
        min-height: 54px;
        padding: 0.35rem 0.2rem;
        color: rgba(255, 255, 255, 0.72);
        background: transparent;
        box-shadow: none;
        border-radius: 8px;
        flex-direction: column;
        gap: 0.12rem;
        font-size: 0.68rem;
        line-height: 1.05;
    }

    #dashboardTabs .nav-link i {
        display: block;
        font-size: 1.2rem;
        line-height: 1;
    }

    #dashboardTabs .nav-link span {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #dashboardTabs .nav-link.active {
        color: #ffffff;
        background: var(--primary);
        box-shadow: 0 10px 22px rgba(85, 0, 166, 0.38);
    }

    .nav-pills:not(#dashboardTabs) .nav-link {
        font-size: 0.82rem;
        padding: 0.48rem 0.52rem;
    }

    h3,
    .h3 {
        font-size: 1.25rem;
    }

    h5,
    .h5 {
        font-size: 1.02rem;
    }

    .plan-price {
        font-size: 1.25rem;
    }
}
