/* Custom styles to complement Bootstrap dark theme */
.certificate-preview {
    border: 1px solid var(--bs-border-color);
    padding: 20px;
    border-radius: 8px;
    background-color: var(--bs-dark);
}

.upload-area {
    border: 2px dashed var(--bs-border-color);
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    margin: 20px 0;
}

.dashboard-stat {
    background-color: var(--bs-dark);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.dashboard-stat h3 {
    color: var(--bs-primary);
    margin-bottom: 10px;
}

.signature-preview {
    max-width: 200px;
    border: 1px solid var(--bs-border-color);
    padding: 10px;
    margin: 10px 0;
}

.seal-preview {
    max-width: 150px;
    border: 1px solid var(--bs-border-color);
    padding: 10px;
    margin: 10px 0;
}

/* Form styling */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Table styling */
.table-responsive {
    background-color: var(--bs-dark);
    border-radius: 8px;
    padding: 15px;
}

/* Card styling */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    background-color: var(--bs-dark);
    border-bottom: 1px solid var(--bs-border-color);
}

/* Form validation styling */
.form-control.is-invalid {
    border-color: var(--bs-danger);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid {
    border-color: var(--bs-success);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--bs-danger);
}

.alert {
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.alert-dismissible {
    padding-right: 3rem;
}

.alert-success {
    color: var(--bs-success);
    background-color: var(--bs-dark);
    border-color: var(--bs-success);
}

.alert-danger {
    color: var(--bs-danger);
    background-color: var(--bs-dark);
    border-color: var(--bs-danger);
}

.alert-warning {
    color: var(--bs-warning);
    background-color: var(--bs-dark);
    border-color: var(--bs-warning);
}

/* Form field focus states */
.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Brand styling */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.logo-p, .logo-r {
    position: relative;
    font-weight: 900;
    font-size: 1.8rem;
}

.logo-p {
    color: #dc3545;  /* Bootstrap red */
    margin-right: -0.5em;
    z-index: 2;
}

.logo-r {
    color: #0d6efd;  /* Bootstrap blue */
    margin-right: 0.5em;
    z-index: 1;
}

/* ── "See How It Works" hero button ─────────────────────────────────── */
.btn-how-it-works {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.15) 0%, rgba(79, 195, 247, 0.05) 100%);
    color: #4fc3f7;
    border: 2px solid #4fc3f7;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}

.btn-how-it-works:hover,
.btn-how-it-works:focus {
    background: #4fc3f7;
    color: #0f3460;
    box-shadow: 0 0 18px rgba(79, 195, 247, 0.45);
    transform: translateY(-2px);
}

.btn-how-it-works:active {
    transform: translateY(0);
}

/* ── How It Works Modal ──────────────────────────────────────────────── */
.hiw-modal-content {
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
}

.hiw-modal-header {
    background: transparent;
}

/* Section dividers */
.hiw-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding-bottom: 2rem;
}

.hiw-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Step cards */
.hiw-step-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.hiw-step-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(79, 195, 247, 0.35);
}

.hiw-step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #4fc3f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.4);
}

.hiw-step-number--2 {
    background: linear-gradient(135deg, #198754, #20c997);
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.4);
}

.hiw-step-number--3 {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    box-shadow: 0 4px 14px rgba(255, 193, 7, 0.4);
}

/* Feature cards */
.hiw-feature-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.hiw-feature-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
}

.hiw-feature-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Benefit cards */
.hiw-benefit-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.hiw-benefit-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* Responsive tweaks */
@media (max-width: 576px) {
    .hiw-step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ── Stable motion (dashboards / charts / progress) ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Chart.js: fixed height stops responsive resize feedback loops on dashboards */
.pr-chart-canvas {
    position: relative;
    height: 280px;
    max-height: 280px;
    width: 100%;
}

.pr-chart-canvas--sm {
    height: 220px;
    max-height: 220px;
}

.pr-chart-canvas canvas {
    display: block;
    max-height: 100%;
}

/* Multi-segment stats: stacked bars (avoids flex jitter from side-by-side bars) */
.progress.progress-stacked {
    min-height: 1rem;
}

/* Dashboard progress bars are informational — no Bootstrap stripe animation */
.dashboard-stat .progress-bar,
.card .progress-bar:not(.pr-motion-ok) {
    animation: none;
}

/* ── App shell & navigation (2026 UI refresh) ───────────────────────────── */
:root {
    --pr-bg: #090b10;
    --pr-bg-elevated: #111520;
    --pr-surface: #151a24;
    --pr-surface-hover: #1c2330;
    --pr-border: rgba(255, 255, 255, 0.08);
    --pr-border-strong: rgba(255, 255, 255, 0.14);
    --pr-text: #eef1f6;
    --pr-text-muted: #8b95a8;
    --pr-accent: #5eb8ff;
    --pr-accent-strong: #3d9eea;
    --pr-accent-glow: rgba(94, 184, 255, 0.25);
    --pr-radius: 14px;
    --pr-radius-sm: 10px;
    --pr-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    --pr-font: "DM Sans", system-ui, -apple-system, sans-serif;
}

.pr-app {
    font-family: var(--pr-font);
    background: radial-gradient(1200px 600px at 10% -10%, rgba(94, 184, 255, 0.08), transparent 55%),
                radial-gradient(900px 500px at 90% 0%, rgba(13, 110, 253, 0.06), transparent 50%),
                var(--pr-bg);
    color: var(--pr-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pr-main {
    flex: 1;
    padding-bottom: 2rem;
}

.pr-flash-container {
    padding-top: 1rem;
}

.pr-page {
    padding-top: 0.5rem;
    padding-bottom: 2rem;
}

.pr-navbar {
    background: rgba(9, 11, 16, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--pr-border);
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    /* backdrop-filter makes the navbar its own stacking context, so its
       dropdowns can't out-rank later page content on their own z-index.
       Lift the whole navbar (Bootstrap's navbar tier) so menus stay on top. */
    position: relative;
    z-index: 1030;
}

.pr-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.pr-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #dc3545 0%, #0d6efd 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.35);
}

.pr-brand-text {
    color: var(--pr-text);
}

.pr-nav-link {
    color: var(--pr-text-muted) !important;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.45rem 0.75rem !important;
    border-radius: var(--pr-radius-sm);
    transition: color 0.15s ease, background 0.15s ease;
}

.pr-nav-link:hover,
.pr-nav-link:focus {
    color: var(--pr-text) !important;
    background: rgba(255, 255, 255, 0.05);
}

.pr-nav-link.active {
    color: var(--pr-accent) !important;
    background: var(--pr-accent-glow);
}

.pr-nav-link--muted {
    font-size: 0.88rem;
}

.pr-dropdown-menu {
    background: var(--pr-surface);
    border: 1px solid var(--pr-border-strong);
    border-radius: var(--pr-radius-sm);
    padding: 0.35rem;
    box-shadow: var(--pr-shadow);
}

.pr-dropdown-menu .dropdown-item {
    color: var(--pr-text);
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
}

.pr-dropdown-menu .dropdown-item:hover,
.pr-dropdown-menu .dropdown-item:focus {
    background: var(--pr-surface-hover);
    color: var(--pr-text);
}

.pr-dropdown-menu .dropdown-header {
    color: var(--pr-text-muted);
    font-size: 0.8rem;
}

.pr-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pr-accent-strong), #20c997);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-pr-primary {
    background: linear-gradient(135deg, var(--pr-accent-strong), #4fc3f7);
    border: none;
    color: #0a1628;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 999px;
}

.btn-pr-primary:hover {
    filter: brightness(1.08);
    color: #0a1628;
}

.pr-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.75rem;
}

.pr-page-header__eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pr-accent);
    margin-bottom: 0.35rem;
}

.pr-page-header__title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1.2;
}

.pr-page-header__subtitle {
    color: var(--pr-text-muted);
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
    max-width: 36rem;
}

.pr-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pr-callout {
    border-radius: var(--pr-radius);
    border: 1px solid var(--pr-border);
    background: var(--pr-surface);
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
}

.pr-callout--warning {
    border-color: rgba(255, 193, 7, 0.35);
    background: rgba(255, 193, 7, 0.06);
}

.pr-callout--info {
    border-color: rgba(94, 184, 255, 0.35);
    background: rgba(94, 184, 255, 0.06);
}

.pr-callout--neutral {
    background: var(--pr-bg-elevated);
}

.pr-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pr-stat-card,
.dashboard-stat {
    background: var(--pr-surface);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius);
    padding: 1.15rem 1.25rem;
    margin-bottom: 0;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.pr-stat-card:hover,
.dashboard-stat:hover {
    border-color: var(--pr-border-strong);
}

.pr-stat-card__label,
.dashboard-stat h3 {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pr-text-muted);
    margin-bottom: 0.75rem;
}

.pr-stat-card__value {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.pr-stat-card__meta {
    color: var(--pr-text-muted);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.pr-panel {
    background: var(--pr-surface);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius);
    overflow: hidden;
}

.pr-panel__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--pr-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pr-panel__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.pr-panel__body {
    padding: 1.25rem;
}

.pr-app .card {
    background: var(--pr-surface);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius);
    box-shadow: none;
}

.pr-app .card-header {
    background: transparent;
    border-bottom: 1px solid var(--pr-border);
    padding: 1rem 1.25rem;
}

.pr-app .card-body {
    padding: 1.25rem;
}

.pr-app .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--pr-text);
    --bs-table-border-color: var(--pr-border);
}

.pr-app .list-group-item {
    background: transparent;
    border-color: var(--pr-border);
    color: var(--pr-text);
}

.pr-app .form-control,
.pr-app .form-select {
    background: var(--pr-bg-elevated);
    border-color: var(--pr-border-strong);
    color: var(--pr-text);
}

.pr-app .form-control:focus,
.pr-app .form-select:focus {
    background: var(--pr-bg-elevated);
    border-color: var(--pr-accent);
    color: var(--pr-text);
    box-shadow: 0 0 0 0.2rem var(--pr-accent-glow);
}

.pr-app .form-control::placeholder {
    color: var(--pr-text-muted);
}

.pr-app .input-group-text {
    background: var(--pr-surface);
    border-color: var(--pr-border-strong);
    color: var(--pr-text-muted);
}

.pr-form-panel {
    max-width: 960px;
}

.pr-form-panel .pr-panel__body {
    padding: 1.5rem 1.35rem;
}

.pr-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--pr-border);
}

.pr-table-panel .table {
    margin-bottom: 0;
}

.pr-table-panel .table thead th {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pr-text-muted);
    border-bottom-color: var(--pr-border);
}

.pr-search-toolbar .btn.active {
    background: var(--pr-accent-glow);
    border-color: var(--pr-accent);
    color: var(--pr-accent);
}

.pr-result-card {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.pr-result-card:hover {
    transform: translateY(-2px);
    border-color: var(--pr-border-strong);
}

.pr-footer {
    border-top: 1px solid var(--pr-border);
    background: var(--pr-bg-elevated);
    padding: 1.25rem 0;
}

.pr-footer a {
    color: var(--pr-text-muted);
    text-decoration: none;
}

.pr-footer a:hover {
    color: var(--pr-accent);
}

@media (max-width: 991.98px) {
    .pr-navbar .dropdown-menu {
        border: none;
        background: transparent;
        box-shadow: none;
        padding-left: 0.5rem;
    }
}
