/* ============================================================
   Adviser.Net.Auth — Backoffice Custom Styles
   ============================================================ */

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 252px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.25);
}

.sidebar-brand {
    padding: 1.4rem 1.25rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #e4392d 0%, #e4392db8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}

.sidebar-brand-title {
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    display: block;
    line-height: 1.3;
}

.sidebar-brand-sub {
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.65rem;
    display: block;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.sidebar-section {
    padding: 1rem 1.25rem 0.3rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.3);
}

.sidebar-nav .nav-link {
    padding: 0.6rem 1.25rem;
    color: rgba(255, 255, 255, 0.58);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    border-radius: 0;
}

.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.06);
    border-left-color: rgba(255, 255, 255, 0.2);
}

.sidebar-nav .nav-link.active {
    color: #a5b4fc;
    background: rgba(79, 70, 229, 0.2);
    border-left-color: #e4392d;
    font-weight: 600;
}

.sidebar-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Main Wrapper ---- */
.main-wrapper {
    margin-left: 252px;
    min-height: 100vh;
    background: #f1f5f9;
}

.page-content {
    padding: 1.75rem 2rem 2.5rem;
}

/* ---- Page Header ---- */
.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header-left .page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.page-header-left .page-subtitle {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

.title-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ---- Cards ---- */
.card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
    background: white;
}

.card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-radius: 11px 11px 0 0 !important;
    padding: 0.875rem 1.25rem !important;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}

.card-header i {
    color: #e4392d;
    font-size: 0.85rem;
}

.card-footer {
    border-top: 1px solid #e2e8f0 !important;
    border-radius: 0 0 11px 11px !important;
    background: #f8fafc !important;
    padding: 0.75rem 1.25rem !important;
}

/* ---- Table Wrapper ---- */
.table-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    background: white;
}

.table-wrapper .table {
    margin-bottom: 0;
}

.table-wrapper .table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    border-top: none;
    color: #64748b;
    font-size: 0.71rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.875rem 1.1rem;
    white-space: nowrap;
}

.table-wrapper .table tbody td {
    padding: 0.8rem 1.1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
    color: #374151;
    font-size: 0.875rem;
}

.table-wrapper .table tbody tr:hover {
    background: #f8f9ff;
}

.table-wrapper .table tbody tr:last-child td {
    border-bottom: none;
}

.table-footer {
    padding: 0.6rem 1.1rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.78rem;
    color: #94a3b8;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 0.75rem !important;
    font-size: 0.8rem;
}

.breadcrumb-item a {
    color: #e4392d;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #64748b;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #cbd5e1;
}

/* ---- Buttons ---- */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, #e4392d, #6366f1) !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #4338ca, #e4392d) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4) !important;
}

.btn-sm {
    font-size: 0.78rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
}

/* ---- Forms ---- */
.form-control,
.form-select {
    border-radius: 8px;
    border-color: #d1d5db;
    font-size: 0.875rem;
    color: #374151;
}

.form-control:focus,
.form-select:focus {
    border-color: #e4392d;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.form-check-input:checked {
    background-color: #e4392d;
    border-color: #e4392d;
}

.input-group-text {
    border-color: #d1d5db;
    border-radius: 8px 0 0 8px;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem !important;
}

.empty-icon {
    font-size: 2.75rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state h6 {
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.empty-state p {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

/* ---- Badges ---- */
.badge {
    color: white !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    font-size: 0.72rem !important;
    padding: 0.3em 0.6em !important;
}

/* ---- Alert ---- */
.alert {
    border-radius: 10px;
    border: none;
    font-size: 0.875rem;
}

/* ---- Theme card color header override ---- */
.card-header.theme-header {
    border-radius: 11px 11px 0 0 !important;
}

/* ---- Spinner ---- */
.spinner-border {
    color: #e4392d;
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .main-wrapper {
        margin-left: 0;
    }
}

.loading-progress {
	position: relative;
	display: block;
	width: 8rem;
	height: 8rem;
	margin: 20vh auto 1rem auto;
}

.loading-progress circle {
	fill: none;
	stroke: #e0e0e0;
	stroke-width: 0.6rem;
	transform-origin: 50% 50%;
	transform: rotate(-90deg);
}

.loading-progress circle:last-child {
	stroke: #1b6ec2;
	stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
	transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
	position: absolute;
	text-align: center;
	font-weight: bold;
	inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
	content: var(--blazor-load-percentage-text, "Loading");
}

/*Prealoder*/
#preloader {
  position: fixed;
  top: 0px;
  left: 0px;
  right: 0px;
  bottom: 0px;
  z-index: 99999;
  transition: all 200ms ease;
}
#preloader .spinner-border {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -15px;
}

.preloader-hide {
  opacity: 0;
  pointer-events: none;
  transition: all 150ms ease !important;
}

.theme-light #preloader {
  background-color: #FFF;
}

.theme-dark #preloader {
  background-color: #0f1117;
}

/* ============================================================
   Page de Login — Styles
   ============================================================ */

.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Cercles décoratifs en arrière-plan */
.login-wrapper::before,
.login-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.08);
    pointer-events: none;
}
.login-wrapper::before {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -200px;
}
.login-wrapper::after {
    width: 400px;
    height: 400px;
    bottom: -150px;
    left: -150px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

/* Branding */
.login-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.login-brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e4392d, #e4392db8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.login-brand-title {
    display: block;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
}

.login-brand-sub {
    display: block;
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.68rem;
}

/* Carte principale */
.login-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.login-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.login-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Indicateur d'étapes */
.login-steps {
    display: flex;
    align-items: center;
    gap: 0;
}

.login-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.login-step.active .step-circle {
    border-color: #e4392d;
    background: #e4392d;
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.login-step.done .step-circle {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.login-step span {
    font-size: 0.73rem;
    color: #9ca3af;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-step.active span {
    color: #e4392d;
    font-weight: 600;
}

.step-divider {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 0.5rem;
}

/* Input TOTP */
.totp-input {
    letter-spacing: 0.3em;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 10px;
    border: 2px solid #d1d5db;
    transition: border-color 0.15s ease;
}

.totp-input:focus {
    border-color: #e4392d;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Setup TOTP */
.totp-setup-box {
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
}

.totp-setup-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e4392d, #e4392db8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.totp-qr-image {
    border-radius: 10px;
    border: 3px solid white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    max-width: 180px;
    image-rendering: pixelated;
}

.totp-manual-key {
    background: white;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 0.6rem 0.875rem;
}

.totp-key-value {
    font-family: monospace;
    font-size: 0.85rem;
    color: #e4392d;
    letter-spacing: 0.12em;
    word-break: break-all;
}

/* Pied de page */
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
}

.btn-success {
    background-color: #8dc492 !important;
    border-color: #8dc492 !important;
    color: white !important;
}

.end-align {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}