:root {
    --br-red: #CC1818;
    --br-red-dark: #A01212;
    --br-red-light: #E83333;
    --br-white: #FFFFFF;
    --br-gray-light: #F8F9FA;
    --br-gray: #6C757D;
    --br-gray-dark: #343A40;
    --br-text: #2D2D2D;
}

/* ============================================
   Typography
   ============================================ */

html, body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    background-color: var(--br-white);
    color: var(--br-text);
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--br-gray-dark) !important;
    font-weight: 700;
}

.text-content {
    font-size: 1.05em;
    line-height: 1.8;
    color: #555;
}

/* ============================================
   Navbar
   ============================================ */

.navbar-biancorosso {
    background-color: var(--br-red) !important;
    color: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 100;
    padding: 0.5rem 1rem;
}

.navbar-biancorosso .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.navbar-biancorosso .nav-link:hover {
    color: white !important;
}

.navbar-brand.riferimenti {
    color: white !important;
}

.nav-bar-logo-img {
    width: 50px;
    border-radius: 8px;
}

.custom-toggler .navbar-toggler-icon {
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255,255,255,1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.custom-toggler {
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.custom-toggler:hover,
.custom-toggler:focus {
    border-color: white;
    box-shadow: none;
}

/* ============================================
   Hero Section
   ============================================ */

.hero-section {
    background: linear-gradient(135deg, var(--br-red) 0%, var(--br-red-dark) 100%);
    position: relative;
    overflow: hidden;
    padding: 80px 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: rgba(255, 255, 255, 0.03);
    transform: rotate(15deg);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5em;
    font-weight: 900;
    color: white !important;
    line-height: 1.1;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.4em;
    font-weight: 300;
    opacity: 0.9;
    margin-top: 15px;
}

.hero-tagline {
    font-size: 1.1em;
    font-weight: 500;
    opacity: 0.7;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 10px;
}

.hero-logo {
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.min-vh-75 {
    min-height: 55vh;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2em;
    }
    .hero-section {
        padding: 50px 0;
    }
}

/* ============================================
   Buttons
   ============================================ */

.btn-biancorosso {
    background-color: var(--br-red);
    color: white;
    border: 2px solid var(--br-red);
    border-radius: 6px;
    font-weight: 600;
    padding: 10px 24px;
    transition: all 0.3s ease;
}

.btn-biancorosso:hover {
    background-color: var(--br-red-dark);
    border-color: var(--br-red-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(204, 24, 24, 0.3);
}

/* ============================================
   Page Header
   ============================================ */

.page-header {
    background: linear-gradient(135deg, var(--br-red) 0%, var(--br-red-dark) 100%);
    color: white;
    padding: 50px 0;
    margin-bottom: 0;
}

.page-header h1 {
    color: white !important;
    font-weight: 800;
}

.page-header .lead {
    opacity: 0.85;
}

/* ============================================
   Values Section
   ============================================ */

.values-section {
    background-color: var(--br-gray-light);
}

.value-card {
    background: white;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.value-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.value-icon {
    font-size: 3em !important;
    color: var(--br-red);
    margin-bottom: 15px;
}

.value-card h3 {
    color: var(--br-red) !important;
    font-size: 1.3em;
}

/* ============================================
   Services Section
   ============================================ */

.section-title {
    color: var(--br-gray-dark) !important;
    font-weight: 800;
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--br-red);
}

.text-center .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

.service-card {
    background: white;
    border-radius: 12px;
    padding: 25px 20px;
    border: 1px solid #eee;
    transition: all 0.3s ease;
    height: 100%;
    text-align: center;
}

.service-card:hover {
    border-color: var(--br-red);
    box-shadow: 0 5px 20px rgba(204, 24, 24, 0.1);
    transform: translateY(-3px);
}

.service-icon {
    font-size: 2.5em !important;
    color: var(--br-red);
    margin-bottom: 12px;
}

.service-card h5 {
    font-weight: 700;
    font-size: 1em;
}

.service-card p {
    font-size: 0.9em;
    color: #666;
}

/* Servizi detail page */
.service-detail {
    padding: 25px 0;
    border-bottom: 1px solid #eee;
}

.service-detail:last-child {
    border-bottom: none;
}

.service-detail-icon {
    font-size: 4em !important;
    color: var(--br-red);
}

/* ============================================
   CTA Section
   ============================================ */

.cta-section {
    background: linear-gradient(135deg, var(--br-red-dark) 0%, var(--br-red) 100%);
}

.cta-section h2 {
    color: white !important;
}

/* ============================================
   About / Chi Siamo
   ============================================ */

.about-highlight-box {
    background: linear-gradient(135deg, var(--br-red) 0%, var(--br-red-dark) 100%);
    color: white;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
}

.about-highlight-box h3 {
    color: white !important;
}

.about-icon {
    font-size: 3.5em !important;
    margin-bottom: 15px;
}

.stat-box {
    background: var(--br-gray-light);
    border-radius: 12px;
    padding: 25px 15px;
    border-left: 4px solid var(--br-red);
}

.stat-number {
    color: var(--br-red) !important;
    font-weight: 900;
    font-size: 2em;
    margin-bottom: 5px;
}

/* ============================================
   Team
   ============================================ */

.team-card {
    background: var(--br-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    text-align: center;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.team-photo {
    width: 100%;
    aspect-ratio: 2 / 4;
    overflow: hidden;
    background: var(--br-gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-photo img.team-photo-shift-left {
    object-position: calc(50% - 60px) center;
}

.team-placeholder-icon {
    font-size: 5em;
    color: var(--br-gray);
}

.team-info {
    padding: 20px;
}

.team-name {
    margin-bottom: 5px;
    font-size: 1.2em;
}

.team-role {
    display: inline-block;
    background: var(--br-red);
    color: var(--br-white);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    margin-bottom: 12px;
}

.team-desc {
    font-size: 0.9em;
    color: #555;
    line-height: 1.6;
}

/* ============================================
   Contatti
   ============================================ */

.contact-info-card {
    background: var(--br-gray-light);
    border-radius: 12px;
    padding: 25px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-icon {
    font-size: 1.8em;
    color: var(--br-red);
    margin-right: 15px;
    min-width: 40px;
}

/* ============================================
   Articles
   ============================================ */

.article-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.article-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.article-card-body {
    padding: 20px;
}

.article-card-title a {
    color: var(--br-gray-dark);
    text-decoration: none;
    font-weight: 700;
}

.article-card-title a:hover {
    color: var(--br-red);
}

.article-preview {
    font-size: 0.9em;
    color: #666;
    max-height: 80px;
    overflow: hidden;
}

.article-meta {
    color: #999;
    margin-top: 10px;
}

.article-header {
    color: var(--br-gray-dark) !important;
}

.article-site {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ============================================
   Footer
   ============================================ */

footer.biancorosso-footer {
    flex-shrink: 0;
    background-color: var(--br-gray-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 30px 0 15px;
    margin-top: auto;
}

footer.biancorosso-footer h6 {
    color: white !important;
    font-weight: 700;
}

footer.biancorosso-footer p {
    font-size: 0.85em;
    margin-bottom: 5px;
}

.footer-version {
    font-size: 0.7em !important;
    opacity: 0.5;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    background-color: var(--br-gray-dark);
    border-bottom: 3px solid var(--br-red);
}

.side-bar .menu-item {
    color: white !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.side-bar .menu-item:hover {
    background-color: var(--br-red) !important;
    border-color: var(--br-red) !important;
}

/* ============================================
   Registry / Admin
   ============================================ */

.header-grid {
    font-style: italic;
    border-bottom: solid 1px #ccc;
    font-weight: 600;
    font-size: 0.9em;
}

.back-to-grid {
    font-size: 2.5em !important;
    font-weight: bold;
    color: var(--br-red);
    text-decoration: none;
}

.back-to-grid:hover {
    background-color: #fde8e8;
    border-radius: 6px;
    text-decoration: none;
}

.prepare-add-record {
    font-size: 2.5em !important;
    font-weight: bold;
    color: var(--br-red);
    text-decoration: none;
}

.prepare-add-record:hover {
    background-color: #fde8e8;
    border-radius: 6px;
    text-decoration: none;
}

.save-record {
    background-color: var(--br-red);
    color: white;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 1.1em;
    font-weight: bold;
    text-decoration: none;
}

.save-record:hover {
    background-color: var(--br-red-dark);
    color: white;
}

.c-grid {
    margin-top: auto !important;
    margin-bottom: auto !important;
}

.row.r1 {
    background-color: #fdf2f2;
}

.row.r2 {
    background-color: #fff;
}

.row.selectable:hover {
    background-color: #fde8e8;
}

.edit-record {
    min-height: 50px !important;
}

.number {
    text-align: right;
}

#search-window-container {
    position: absolute;
    background-color: #e8e8e8;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 6px;
    padding-bottom: 20px;
    box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.75);
}

#lookup_container_unit {
    position: absolute;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 0 8px #b2b2b2;
    z-index: 1000;
}

#lookup_container_unit .card-body .genre-record.lookup-item {
    line-height: 98%;
    margin: 10px 0px 10px 0px;
    padding: 3px 0px 3px 0px;
}

input.required {
    border: solid 2px orangered;
}

/* ============================================
   Main container
   ============================================ */

.main-container {
    padding: 0;
}
