:root {
    --cbna-orange: #CB4a20;
    --cbna-grey: #ededed;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Sticky footer - always fills remaining screen space */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* CBNA Brand Color Classes */
.bg-cbna-orange {
    background-color: var(--cbna-orange);
}

.bg-cbna-grey {
    background-color: var(--cbna-grey);
}

/* Override Bootstrap primary color with CBNA orange */
.text-primary {
    color: var(--cbna-orange) !important;
}

/* Header text should be black for readability */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: #000 !important;
}

.border-primary {
    border-color: var(--cbna-orange) !important;
}

.border-start.border-primary.border-3 {
    border-left: 4px solid var(--cbna-orange) !important;
}



.navbar-brand {
    font-weight: 600;
    color: white !important;
}

.navbar-brand:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Responsive CBNA Logo */
.navbar-brand img {
    transition: all 0.3s ease;
    /* Compensate for image's internal padding by shifting left */
    margin-left: -15px;
}

/* Mobile: Smaller logo */
@media (max-width: 576px) {
    .navbar-brand img {
        height: 55px !important;
        max-height: 55px !important;
        margin-left: -12px;
    }
}

/* Tablet: Medium logo */
@media (min-width: 577px) and (max-width: 768px) {
    .navbar-brand img {
        height: 65px !important;
        max-height: 65px !important;
        margin-left: -14px;
    }
}

/* Desktop: Full size logo */
@media (min-width: 769px) {
    .navbar-brand img {
        height: 75px !important;
        max-height: 75px !important;
        margin-left: -15px;
    }
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

.card {
    border: none;
    border-radius: 0;
}

.back-to-dashboard {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: #212529 !important;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease-in-out;
}

.back-to-dashboard i {
    font-size: 1rem;
    line-height: 1;
}

.back-to-dashboard:hover,
.back-to-dashboard:focus {
    color: #7c2d12 !important;
    background-color: #ffedd5;
    text-decoration: none;
}

.back-to-dashboard:active {
    color: #7c2d12 !important;
    background-color: #fed7aa;
    text-decoration: none;
}

/* Mobile already provides a host back/close control */
@media (max-width: 768px) {
    .back-to-dashboard {
        display: none;
    }
}

/* Card-face plugin content (tiles only; no outer card chrome) */
.card-face {
    margin: 0.75rem 1rem 1rem;
}

.card-face__greeting {
    font-size: 0.9375rem;
    color: #212529;
    margin: 0 0 1rem;
}

.card-face__tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-face__tile {
    flex: 1 1 0;
    min-width: 6.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    color: #212529 !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.card-face__tile:hover,
.card-face__tile:focus {
    color: #7c2d12 !important;
    background-color: #ffedd5;
    border-color: #fdba74;
    text-decoration: none !important;
}

.card-face__tile:active {
    color: #7c2d12 !important;
    background-color: #fed7aa;
    border-color: #fb923c;
    text-decoration: none !important;
}

.card-face__tile:hover .card-face__tile-icon,
.card-face__tile:focus .card-face__tile-icon,
.card-face__tile:active .card-face__tile-icon,
.card-face__tile:hover .card-face__tile-label,
.card-face__tile:focus .card-face__tile-label,
.card-face__tile:active .card-face__tile-label {
    color: #7c2d12;
}

.card-face__tile-icon {
    font-size: 1.75rem;
    color: #212529;
    line-height: 1;
}

.card-face__tile-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #212529;
    line-height: 1.3;
}

.card-face__more {
    display: block;
    width: 100%;
    text-align: center;
    color: var(--cbna-orange);
    font-size: 0.9375rem;
    font-weight: 500;
    margin-top: 0.75rem;
    text-decoration: none;
    cursor: pointer;
}

.card-face__more:hover,
.card-face__more:focus {
    color: #7c2d12;
    text-decoration: underline;
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.btn-primary {
    color: #fff;
    background-color: var(--cbna-orange);
    border: 2px solid var(--cbna-orange);
    border-radius: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover,
.btn-primary:active {
    background-color: #fff;
    color: var(--cbna-orange);
    border-color: var(--cbna-orange);
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(203, 74, 32, 0.3);
}

.btn-primary:focus {
    background-color: var(--cbna-orange);
    border-color: var(--cbna-orange);
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(203, 74, 32, 0.25);
}

.btn-primary:active {
    background-color: var(--cbna-orange);
    border-color: var(--cbna-orange);
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(203, 74, 32, 0.25);
}

.btn-primary:disabled {
    background-color: var(--cbna-orange);
    border-color: var(--cbna-orange);
    color: #fff;
    opacity: 0.6;
}

.form-control, .form-select {
    border-radius: 0;
    border: 1px solid #ced4da;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #1b6ec2;
    box-shadow: 0 0 0 0.2rem rgba(27, 110, 194, 0.25);
}

/* Ensure select dropdowns open downward */
.form-select {
    position: relative;
}

.form-select:focus {
    z-index: 3;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.currency-limit-input {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: text;
}

.currency-limit-input:focus-within {
    border-color: #1b6ec2;
    box-shadow: 0 0 0 0.2rem rgba(27, 110, 194, 0.25);
}

.currency-limit-input__prefix,
.currency-limit-input__suffix {
    flex: 0 0 auto;
    user-select: none;
    pointer-events: none;
}

.currency-limit-input__prefix {
    color: #495057;
    font-weight: 500;
}

.currency-limit-input__suffix {
    margin-left: 0.125rem;
    color: #6c757d;
}

.currency-limit-input__field {
    flex: 1 1 auto;
    min-width: 2.5ch;
    border: 0;
    outline: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: right;
}

.currency-limit-input__field::placeholder {
    color: #adb5bd;
}


.footer {
    width: 100%;
    white-space: nowrap;
    line-height: normal;
    padding: 1rem 0;
    background-color: var(--cbna-grey) !important;
    color: #000 !important;
    margin-top: auto;
}

.footer a {
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.footer a:hover {
    color: var(--cbna-orange) !important;
}

.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Focus states for keyboard navigation */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Tablet and below (768px and down) */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .card-face__tile {
        flex: 1 1 calc(33.333% - 0.75rem);
        min-width: 5.5rem;
    }

    .footer {
        font-size: 0.9rem;
        padding: 0.75rem 0;
    }

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

    .footer .text-md-end {
        text-align: center !important;
    }
}

/* Small mobile devices (667px and down) */
@media (max-width: 667px) {
    .footer {
        padding: 0.5rem 0;
        min-height: 50px;
    }
}

/* Extra small mobile devices (576px and down) */
@media (max-width: 576px) {
    html {
        font-size: 13px;
    }

    .card-body {
        padding: 1rem;
    }

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

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

/* DocuSign Success Screen Styles */
.success-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 0;
}

.success-icon i {
    font-size: 2.5rem;
}

.success-screen .btn-lg {
    min-width: 180px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.success-screen .card-body {
    padding: 2rem !important;
}

.success-screen h1 {
    font-size: 1.75rem;
}

.success-screen .fs-5 {
    font-size: 1rem !important;
}

@media (max-width: 768px) {
    .success-icon i {
        font-size: 2rem;
    }
    
    .success-screen .card-body {
        padding: 1.5rem !important;
    }
    
    .success-screen .btn-lg {
        min-width: 100%;
    }
    
    .success-screen h1 {
        font-size: 1.5rem;
    }
}
