/* =========================================================
   DOCUMENT VAULT
   Bootstrap theme overrides
   ========================================================= */

:root {
    --red: #E0202C;
    --red-dark: #b91923;
    --red-light: #fbe3e5;

    --cream: #f6efe1;
    --cream-dark: #eadfca;

    --text: #191919;
    --text-muted: #6f6a63;

    --border: rgba(25, 25, 25, 0.12);
    --border-strong: rgba(25, 25, 25, 0.2);

    --white: #ffffff;
}


/* =========================================================
   BASE
   ========================================================= */

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;

    background: transparent;
    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

main {
    min-height: calc(100vh - 150px);
    padding: 60px 0;
}

h1,
h2,
h3,
h4 {
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-muted);
}


/* =========================================================
   LINKS
   ========================================================= */

a {
    color: var(--red);
    text-decoration: none;
}

a:hover {
    color: var(--red-dark);
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.site-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
}

.logo {
    color: var(--text) !important;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.logo:hover {
    color: var(--red) !important;
}

.nav-link {
    color: var(--text) !important;
    font-weight: 600;
}

.nav-link:hover {
    color: var(--red) !important;
}

.navbar-toggler {
    border-color: var(--border-strong);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(224, 32, 44, 0.12);
}


/* =========================================================
   BOOTSTRAP BUTTON OVERRIDES
   ========================================================= */

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--red);
    --bs-btn-border-color: var(--red);

    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--red-dark);
    --bs-btn-hover-border-color: var(--red-dark);

    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--red-dark);
    --bs-btn-active-border-color: var(--red-dark);

    --bs-btn-focus-shadow-rgb: 224, 32, 44;

    font-weight: 700;
}

.btn-outline-primary {
    --bs-btn-color: var(--red);
    --bs-btn-border-color: var(--red);

    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--red);
    --bs-btn-hover-border-color: var(--red);

    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--red-dark);
    --bs-btn-active-border-color: var(--red-dark);

    --bs-btn-focus-shadow-rgb: 224, 32, 44;
}


/* =========================================================
   FORMS
   ========================================================= */

.form-control,
.form-select {
    border-color: var(--border-strong);
    background-color: rgba(255, 255, 255, 0.55);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--red);

    background-color: var(--white);

    box-shadow:
        0 0 0 3px rgba(224, 32, 44, 0.12);
}

.form-label {
    color: var(--text);
    font-weight: 700;
}

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


/* =========================================================
   CARDS
   ========================================================= */

.card {
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card-header {
    background: transparent;
    border-bottom-color: var(--border);
}

.card-title {
    color: var(--text);
}


/* =========================================================
   AUTH
   ========================================================= */

.auth-wrapper {
    min-height: calc(100vh - 150px);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 460px;

    padding: 40px;

    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: 22px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08);
}

.auth-header {
    margin-bottom: 30px;
    text-align: center;
}

.auth-header h1 {
    margin-bottom: 10px;
}

.auth-footer {
    margin-top: 25px;
    padding-top: 20px;

    border-top: 1px solid var(--border);

    text-align: center;
}


/* =========================================================
   PAGE HEADERS
   ========================================================= */

.page-header {
    width: 100%;
    max-width: 850px;

    margin: 0 auto 36px;

    text-align: center;
}

.page-header p {
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   PROFILE
   ========================================================= */

.profile-header {
    width: 100%;
    max-width: 850px;

    margin: 0 auto 40px;

    text-align: center;
}

.profile-intro p {
    margin-bottom: 0;
}


/* =========================================================
   IDENTITY CHECKLIST
   ========================================================= */

.identity-checklist {
    width: 100%;
    max-width: 900px;

    margin: 0 auto 50px;

    display: flex;
    flex-direction: column;

    gap: 18px;
}

.identity-item {
    width: 100%;

    padding: 24px;

    background: var(--cream);

    border: 1px solid var(--border);
    border-radius: 14px;
}

.identity-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
}

.identity-item-header h3 {
    margin-bottom: 8px;
}

.identity-documents {
    margin-top: 20px;

    display: flex;
    flex-direction: column;

    gap: 10px;
}

.identity-document {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 14px 16px;

    background: rgba(255, 255, 255, 0.55);

    border: 1px solid var(--border);
    border-radius: 8px;
}

.identity-upload-form {
    margin-top: 20px;
    padding-top: 20px;

    border-top: 1px solid var(--border);
}


/* =========================================================
   DOCUMENTS
   ========================================================= */

.document-list {
    width: 100%;
    max-width: 1000px;

    margin: 0 auto;

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));

    gap: 18px;
}

.document-card {
    display: flex;
    flex-direction: column;
    align-items: center;

    min-height: 190px;

    padding: 24px;

    background: var(--cream);

    border: 1px solid var(--cream-dark);
    border-radius: 14px;

    text-align: center;

    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        border-color 160ms ease;
}

.document-card:hover {
    transform: translateY(-3px);

    border-color: rgba(224, 32, 44, 0.25);

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08);
}

.document-icon {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 10px;

    background: var(--red);
    color: var(--white);

    font-weight: 800;
}

.document-name {
    margin-bottom: 8px;

    color: var(--text);

    font-size: 1.05rem;
    font-weight: 700;

    word-break: break-word;
}

.document-meta {
    margin-bottom: 20px;

    color: var(--text-muted);

    font-size: 0.85rem;
}

.document-actions {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    margin-top: auto;
}


/* =========================================================
   UPLOAD AREA
   ========================================================= */

.upload-area {
    width: 100%;
    max-width: 850px;

    margin: 0 auto 40px;

    padding: 35px;

    border: 2px dashed var(--border-strong);
    border-radius: 22px;

    background: rgba(246, 239, 225, 0.5);

    text-align: center;
}

.upload-area:hover {
    border-color: var(--red);
    background: var(--cream);
}


/* =========================================================
   ACCOUNT
   ========================================================= */

.account-grid {
    width: 100%;
    max-width: 900px;

    margin: 0 auto;

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(280px, 1fr));

    gap: 20px;
}

.account-item {
    padding: 22px;

    background: var(--cream);

    border: 1px solid var(--cream-dark);
    border-radius: 14px;

    text-align: center;
}

.account-label {
    display: block;

    margin-bottom: 5px;

    color: var(--text-muted);

    font-size: 0.82rem;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.account-value {
    color: var(--text);

    font-size: 1.05rem;
    font-weight: 650;

    overflow-wrap: anywhere;
}


/* =========================================================
   BADGES
   ========================================================= */

.badge {
    background: var(--cream-dark);
    color: var(--text);

    font-weight: 700;
}

.badge-red {
    background: var(--red-light);
    color: var(--red-dark);
}

/* =========================================================
   DOCUMENT CHECKLIST / COLLAPSABLES
   ========================================================= */

/* Required-document accordion */
#requiredDocumentsAccordion {
    --accordion-border: var(--cream-dark);
}

#requiredDocumentsAccordion .accordion-item {
    background: var(--cream);
    border: 1px solid var(--cream-dark) !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Category header */
#requiredDocumentsAccordion .accordion-button {
    position: relative;

    background: var(--cream);
    color: var(--text);

    border: 0;
    border-radius: 14px !important;

    font-weight: 700;

    box-shadow: none;
    transition:
        background-color 160ms ease,
        color 160ms ease;
}

/* Remove Bootstrap's blue focus/background */
#requiredDocumentsAccordion .accordion-button:not(.collapsed) {
    background: var(--cream);
    color: var(--text);

    box-shadow: none;
}

/* Hover state */
#requiredDocumentsAccordion .accordion-button:hover {
    background: var(--cream-dark);
    color: var(--text);
}

/* Keyboard focus */
#requiredDocumentsAccordion .accordion-button:focus {
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(224, 32, 44, 0.12);
}

/* Bootstrap accordion chevron */
#requiredDocumentsAccordion .accordion-button::after {
    width: 0.8rem;
    height: 0.8rem;

    margin-left: 1rem;

    background-size: 0.8rem;
    opacity: 0.65;
}

/* Open accordion */
#requiredDocumentsAccordion .accordion-button:not(.collapsed)::after {
    opacity: 1;
}

/* Accordion content */
#requiredDocumentsAccordion .accordion-collapse {
    background: var(--white);
    border-top: 1px solid var(--cream-dark);
}

#requiredDocumentsAccordion .accordion-body {
    background: var(--white);
}

/* Requirement rows */
#requiredDocumentsAccordion .list-group-item {
    background: var(--white);
    color: var(--text);
    border-color: var(--border);
}

/* Nested alternative document cards */
#requiredDocumentsAccordion .list-group-item .border {
    background: var(--cream);
    border-color: var(--cream-dark) !important;
}


/* =========================================================
   NATIVE DETAILS / SUMMARY
   ========================================================= */

details {
    color: var(--text);
}

details > summary {
    cursor: pointer;
    list-style: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

/* Add a small disclosure indicator */
details > summary::after {
    content: "＋";

    display: inline-block;
    margin-left: 0.5rem;

    font-size: 0.9em;
    font-weight: 700;

    transition: transform 160ms ease;
}

details[open] > summary::after {
    content: "−";
}



/* =========================================================
   DOCUMENT STATUS BADGES
   ========================================================= */

/* Bootstrap contextual badges used by the document page */
.badge.text-bg-success {
    background: #e5f3e8 !important;
    color: #246b35 !important;

    border: 1px solid #b9ddc0;
}

.badge.text-bg-warning {
    background: #fff3d6 !important;
    color: #795b16 !important;

    border: 1px solid #ead39a;
}

.badge.text-bg-danger {
    background: var(--red-light) !important;
    color: var(--red-dark) !important;

    border: 1px solid rgba(224, 32, 44, 0.25);
}

.badge.text-bg-secondary {
    background: #ece9e3 !important;
    color: var(--text-muted) !important;

    border: 1px solid var(--border);
}

.badge.text-bg-light {
    background: #f8f7f4 !important;
    color: var(--text-muted) !important;

    border: 1px solid var(--border);
}


/* =========================================================
   ALERT / FLASH MESSAGES
   ========================================================= */

.alert {
    border-radius: 12px;
    border-width: 1px;

    padding: 14px 16px;

    font-weight: 550;
}

/* Success */
.alert-success {
    --bs-alert-color: #246b35;
    --bs-alert-bg: #e5f3e8;
    --bs-alert-border-color: #b9ddc0;
}

/* Warning */
.alert-warning {
    --bs-alert-color: #795b16;
    --bs-alert-bg: #fff3d6;
    --bs-alert-border-color: #ead39a;
}

/* Error */
.alert-danger {
    --bs-alert-color: var(--red-dark);
    --bs-alert-bg: var(--red-light);
    --bs-alert-border-color: rgba(224, 32, 44, 0.3);
}

/* Informational messages */
.alert-info {
    --bs-alert-color: #38566b;
    --bs-alert-bg: #edf3f7;
    --bs-alert-border-color: #cbdce7;
}

/* Remove Bootstrap's default close-button visual dominance */
.alert .btn-close {
    opacity: 0.55;
}

.alert .btn-close:hover {
    opacity: 0.9;
}


/* =========================================================
   UPLOAD FORM INSIDE COLLAPSABLE
   ========================================================= */

details form {
    padding: 14px;

    background: rgba(246, 239, 225, 0.55);

    border: 1px solid var(--border);
    border-radius: 10px;
}

details form .form-control {
    background: var(--white);
}

details form .form-control:focus {
    background: var(--white);
}


/* =========================================================
   DOCUMENT ACTION BUTTONS
   ========================================================= */

/* Upload is the primary action */
details > summary.btn-primary {
    border-color: var(--red);
}

/* Use the quieter outline treatment for disclosure controls */
details > summary.btn-outline-primary {
    font-weight: 700;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    #requiredDocumentsAccordion .accordion-button {
        padding: 16px;
    }

    #requiredDocumentsAccordion .accordion-button .badge {
        flex-shrink: 0;
    }

    details > summary {
        width: 100%;
    }

    details form {
        margin-top: 12px !important;
    }
}



/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    width: 100%;
    max-width: 850px;

    margin: 0 auto;

    padding: 60px 30px;

    border: 1px dashed var(--border-strong);
    border-radius: 22px;

    background: rgba(246, 239, 225, 0.45);

    text-align: center;
}


/* =========================================================
   FLASH / BOOTSTRAP ALERTS
   ========================================================= */

.alert {
    border-radius: 8px;
}

.alert-danger {
    --bs-alert-color: var(--red-dark);
    --bs-alert-bg: var(--red-light);
    --bs-alert-border-color: rgba(224, 32, 44, 0.3);
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    padding: 35px 0;

    border-top: 1px solid var(--border);

    color: var(--text-muted);

    font-size: 0.85rem;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    main {
        padding: 40px 0;
    }

    .auth-card {
        padding: 28px 22px;
    }

    .identity-item {
        padding: 20px;
    }

    .identity-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .identity-document {
        flex-direction: column;
        align-items: flex-start;
    }

    .identity-document .document-actions {
        width: 100%;
    }

    .identity-document .document-actions .btn,
    .identity-document .document-actions button {
        width: 100%;
    }

    .document-actions {
        width: 100%;
        flex-direction: column;
    }

    .document-actions .btn,
    .document-actions button {
        width: 100%;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
