/*
 * Kabureinu Unipessoal Lda – Public Website Styles
 * main.css — Loaded by templates/base.html
 * ─────────────────────────────────────────────────
 */

/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS — LIGHT MODE (default)
═══════════════════════════════════════════════════════════════ */
:root,
[data-theme="light"] {
    --brand-red:       #C8102E;
    --brand-red-hover: #a50d24;
    --brand-green:     #1C7A33;
    --brand-green-hover:#165E28;
    --brand-accent:    #1C7A33;
    --font-display:    'Syne', sans-serif;
    --font-body:       'DM Sans', sans-serif;
    --radius:          6px;
    --ease:            0.25s cubic-bezier(.4, 0, .2, 1);

    /* Surfaces */
    --bg-body:         #F4F6FA;
    --bg-surface:      #FFFFFF;
    --bg-card:         #FFFFFF;
    --bg-card-hover:   #F8FAFD;
    --bg-alt:          #EFF2F7;
    --bg-input:        #FFFFFF;
    --bg-badge-red:    rgba(200, 16, 46, .09);

    /* Text */
    --tx-primary:      #111827;
    --tx-secondary:    #4B5563;
    --tx-muted:        #9CA3AF;
    --tx-heading:      #0D1117;

    /* Borders */
    --bd-color:        #E5E7EB;
    --bd-input:        #D1D5DB;

    /* Always-dark elements */
    --nav-bg:          #0D1117;
    --nav-top:         #161E2E;
    --footer-bg:       #0D1117;

    /* Shadows */
    --sh-sm:  0 1px 4px rgba(0, 0, 0, .07);
    --sh-md:  0 4px 18px rgba(0, 0, 0, .09);
    --sh-lg:  0 12px 40px rgba(0, 0, 0, .11);
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE TOKENS
═══════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --bg-body:         #07090F;
    --bg-surface:      #0D1117;
    --bg-card:         #111927;
    --bg-card-hover:   #172033;
    --bg-alt:          #0A0E18;
    --bg-input:        #1A2336;
    --bg-badge-red:    rgba(200, 16, 46, .14);

    --tx-primary:      rgba(255, 255, 255, .88);
    --tx-secondary:    rgba(255, 255, 255, .58);
    --tx-muted:        rgba(255, 255, 255, .32);
    --tx-heading:      #F0F4FF;

    --bd-color:        rgba(255, 255, 255, .07);
    --bd-input:        rgba(255, 255, 255, .13);

    --sh-sm:  0 1px 4px rgba(0, 0, 0, .50);
    --sh-md:  0 4px 18px rgba(0, 0, 0, .55);
    --sh-lg:  0 12px 40px rgba(0, 0, 0, .65);
}

/* ═══════════════════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-body);
    color: var(--tx-primary);
    font-size: 16px;
    line-height: 1.65;
    transition: background var(--ease), color var(--ease);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--tx-heading);
    transition: color var(--ease);
}

p {
    color: var(--tx-secondary);
    transition: color var(--ease);
}

a { transition: color var(--ease); }

img { max-width: 100%; height: auto; }

/* ═══════════════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
═══════════════════════════════════════════════════════════════ */
.theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .07);
    color: rgba(255, 255, 255, .82);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: background var(--ease), border-color var(--ease), transform .2s;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .45);
    transform: rotate(18deg) scale(1.05);
}

.theme-btn .t-sun,
.theme-btn .t-moon {
    position: absolute;
    transition: opacity .22s, transform .22s;
}

[data-theme="light"] .theme-btn .t-moon { opacity: 1; transform: scale(1); }
[data-theme="light"] .theme-btn .t-sun  { opacity: 0; transform: scale(.4) rotate(-90deg); }
[data-theme="dark"]  .theme-btn .t-sun  { opacity: 1; transform: scale(1); }
[data-theme="dark"]  .theme-btn .t-moon { opacity: 0; transform: scale(.4) rotate(90deg); }

/* ═══════════════════════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════════════════════ */
.topbar {
    background: var(--nav-top);
    padding: 7px 0;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .52);
    border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.topbar a {
    color: rgba(255, 255, 255, .68);
    text-decoration: none;
    transition: color var(--ease);
}

.topbar a:hover { color: var(--brand-accent); }
.topbar .bi { margin-right: 4px; color: var(--brand-red); }

/* ═══════════════════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════════════════ */
.navbar-kab {
    background: var(--nav-bg);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 24px rgba(0, 0, 0, .48);
}

.navbar-kab .navbar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 0;
    text-decoration: none;
}

.brand-box {
    width: 43px;
    height: 43px;
    background: var(--brand-red);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 17px;
    color: #fff;
    letter-spacing: -1px;
    flex-shrink: 0;
}

.brand-main {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 14.5px;
    color: #fff;
    line-height: 1.1;
}

.brand-sub {
    font-size: 9.5px;
    color: rgba(255, 255, 255, .45);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.navbar-kab .nav-link {
    color: rgba(255, 255, 255, .72) !important;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 25px 15px !important;
    position: relative;
    transition: color var(--ease);
}

.navbar-kab .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 3px;
    background: var(--brand-red);
    transition: left var(--ease), right var(--ease);
}

.navbar-kab .nav-link:hover,
.navbar-kab .nav-link.active { color: #fff !important; }

.navbar-kab .nav-link:hover::after,
.navbar-kab .nav-link.active::after { left: 15px; right: 15px; }

.nav-cta {
    background: var(--brand-red) !important;
    color: #fff !important;
    border-radius: var(--radius) !important;
    padding: 9px 20px !important;
    margin-left: 6px;
    font-weight: 700 !important;
    transition: background var(--ease) !important;
}

.nav-cta::after { display: none !important; }
.nav-cta:hover  { background: var(--brand-red-hover) !important; }

/* ═══════════════════════════════════════════════════════════════
   SECTIONS
═══════════════════════════════════════════════════════════════ */
.sec-white,
.section-light { background: var(--bg-surface); transition: background var(--ease); }

.sec-alt,
.section-alt   { background: var(--bg-alt);     transition: background var(--ease); }

.sec-dark,
.section-dark  { background: #0D1117; }

/* ═══════════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════════ */
.kab-card {
    background: var(--bg-card);
    border: 1px solid var(--bd-color);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow var(--ease), transform var(--ease),
                background var(--ease), border-color var(--ease);
}

.kab-card:hover {
    box-shadow: var(--sh-lg);
    transform: translateY(-4px);
    background: var(--bg-card-hover);
}

.kab-card .card-img-top { height: 200px; object-fit: cover; }
.kab-card .card-body    { padding: 22px; }

/* ═══════════════════════════════════════════════════════════════
   SERVICE ICON
═══════════════════════════════════════════════════════════════ */
.service-icon {
    width: 54px;
    height: 54px;
    background: var(--bg-badge-red);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    color: var(--brand-red);
    margin-bottom: 16px;
    transition: background var(--ease), color var(--ease);
}

.kab-card:hover .service-icon { background: var(--brand-red); color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY HELPERS
═══════════════════════════════════════════════════════════════ */
.sec-label,
.section-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--brand-red);
    margin-bottom: 10px;
    display: block;
}

.sec-title,
.section-title {
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    font-weight: 800;
    color: var(--tx-heading);
    margin-bottom: 14px;
    transition: color var(--ease);
}

.sec-title span,
.section-title span { color: var(--brand-red); }

.sec-lead,
.section-lead {
    font-size: 17px;
    color: var(--tx-secondary);
    max-width: 600px;
}

.sec-divider,
.section-divider {
    width: 48px;
    height: 4px;
    background: var(--brand-red);
    border-radius: 2px;
    margin-bottom: 18px;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════ */
.btn-brand {
    background: var(--brand-red);
    color: #fff;
    border: none;
    padding: 11px 26px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: .4px;
    border-radius: var(--radius);
    transition: background var(--ease), transform var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    cursor: pointer;
}

.btn-brand:hover {
    background: var(--brand-red-hover);
    color: #fff;
    transform: translateY(-2px);
}

.btn-outline-brand {
    background: transparent;
    color: var(--brand-red);
    border: 2px solid var(--brand-red);
    padding: 9px 24px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13.5px;
    border-radius: var(--radius);
    transition: all var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    cursor: pointer;
}

.btn-outline-brand:hover { background: var(--brand-red); color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════════ */
.badge-brand {
    background: var(--bg-badge-red);
    color: var(--brand-red);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 11px;
    border-radius: 4px;
}

.badge-success-soft {
    background: rgba(28, 122, 51, .13);
    color: #059669;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
}

[data-theme="dark"] .badge-success-soft { color: #34d399; }

/* ═══════════════════════════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════════════════════════ */
.stat-card { text-align: center; padding: 30px 20px; }

.stat-number {
    font-family: var(--font-display);
    font-size: 2.9rem;
    font-weight: 800;
    color: var(--brand-red);
    line-height: 1;
}

.stat-label {
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--tx-muted);
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER (inner pages)
═══════════════════════════════════════════════════════════════ */
.page-header {
    background: linear-gradient(135deg, #0D1117 0%, #1C2333 100%);
    padding: 70px 0 54px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    right: -90px;
    top: -90px;
    width: 380px;
    height: 380px;
    background: var(--brand-red);
    border-radius: 50%;
    opacity: .055;
}

.page-header h1 {
    color: #fff;
    font-size: clamp(1.9rem, 5vw, 3.3rem);
}

.page-header .breadcrumb       { background: transparent; padding: 0; margin: 0; }
.page-header .breadcrumb-item  { color: rgba(255, 255, 255, .48); font-size: 13px; }
.page-header .breadcrumb-item.active { color: rgba(255, 255, 255, .78); }
.page-header .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .28); }
.page-header .breadcrumb-item a { color: var(--brand-red); text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════════ */
.form-control,
.form-select {
    background:   var(--bg-input)   !important;
    border-color: var(--bd-input)   !important;
    color:        var(--tx-primary) !important;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-red) !important;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, .14) !important;
}

.form-control::placeholder { color: var(--tx-muted) !important; }
.form-label                { color: var(--tx-secondary); }

[data-theme="dark"] .form-select option { background: #1A2336; }
[data-theme="dark"] .form-label         { color: var(--tx-secondary); }

/* ═══════════════════════════════════════════════════════════════
   TESTIMONIALS
═══════════════════════════════════════════════════════════════ */
.testimonial-card {
    background: var(--bg-card);
    border: 1px solid var(--bd-color);
    border-radius: 12px;
    padding: 28px;
    transition: all var(--ease);
}

.testimonial-card:hover {
    box-shadow: var(--sh-md);
    border-color: rgba(200, 16, 46, .2);
}

.testimonial-stars { color: var(--brand-accent); font-size: 14px; margin-bottom: 14px; }

.testimonial-text {
    font-size: 15px;
    color: var(--tx-secondary);
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 20px;
}

.testimonial-author-name  { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--tx-heading); }
.testimonial-author-title { font-size: 12px; color: var(--tx-muted); }

/* ═══════════════════════════════════════════════════════════════
   TEAM CARDS
═══════════════════════════════════════════════════════════════ */
.team-card {
    background: var(--bg-card);
    border: 1px solid var(--bd-color);
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    transition: all var(--ease);
}

.team-card:hover { box-shadow: var(--sh-lg); transform: translateY(-4px); }

.team-card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: top;
}

.team-card-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #1C2333, #0D1117);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 3rem;
    color: var(--brand-red);
}

.team-card-body { padding: 20px; }
.team-card-name { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--tx-heading); margin-bottom: 4px; }
.team-card-role { font-size: 12.5px; color: var(--brand-red); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.team-card-dept { font-size: 12px; color: var(--tx-muted); }

/* ═══════════════════════════════════════════════════════════════
   PROJECT CARDS
═══════════════════════════════════════════════════════════════ */
.project-value {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--brand-red);
}

.project-meta { font-size: 13px; color: var(--tx-muted); display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.project-meta span { display: flex; align-items: center; gap: 5px; }

/* ═══════════════════════════════════════════════════════════════
   ASSET TABLE
═══════════════════════════════════════════════════════════════ */
.asset-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.asset-badge-heavy   { background: rgba(59, 130, 246, .1); color: #3B82F6; }
.asset-badge-vehicle { background: rgba(28, 122, 51, .11); color: #1C7A33; }
.asset-badge-office  { background: rgba(28, 122, 51, .1); color: var(--brand-accent); }
.asset-badge-tool    { background: rgba(200, 16, 46, .1);  color: var(--brand-red); }

[data-theme="dark"] .asset-badge-heavy   { color: #60a5fa; }
[data-theme="dark"] .asset-badge-vehicle { color: #34d399; }
[data-theme="dark"] .asset-badge-office  { color: #fbbf24; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER (always dark)
═══════════════════════════════════════════════════════════════ */
.site-footer {
    background: var(--footer-bg);
    color: rgba(255, 255, 255, .62);
    padding: 62px 0 0;
}

.footer-heading {
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .88);
    margin-bottom: 18px;
    padding-bottom: 9px;
    border-bottom: 2px solid var(--brand-red);
    display: inline-block;
}

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 9px; }
.footer-links a { color: rgba(255, 255, 255, .58); text-decoration: none; font-size: 14px; transition: color var(--ease); }
.footer-links a:hover { color: var(--brand-accent); }

.footer-contact-item { display: flex; gap: 11px; margin-bottom: 13px; font-size: 14px; }
.footer-contact-item .bi { color: var(--brand-red); font-size: 15px; flex-shrink: 0; margin-top: 3px; }

.footer-bottom {
    background: rgba(0, 0, 0, .32);
    padding: 15px 0;
    margin-top: 48px;
    font-size: 13px;
    color: rgba(255, 255, 255, .38);
}

.footer-nl-input {
    background: rgba(255, 255, 255, .07) !important;
    border-color: rgba(255, 255, 255, .14) !important;
    color: #fff !important;
}

.footer-nl-input::placeholder { color: rgba(255, 255, 255, .38) !important; }

/* ═══════════════════════════════════════════════════════════════
   BOOTSTRAP DARK-MODE OVERRIDES
═══════════════════════════════════════════════════════════════ */
[data-theme="dark"] .text-muted  { color: var(--tx-muted)  !important; }
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light    { background: var(--bg-card) !important; }
[data-theme="dark"] .border      { border-color: var(--bd-color) !important; }
[data-theme="dark"] .table       { color: var(--tx-primary); }
[data-theme="dark"] .table th    { color: var(--tx-secondary); border-color: var(--bd-color); }
[data-theme="dark"] .table td    { border-color: var(--bd-color); }
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { background: rgba(255, 255, 255, .02); }
[data-theme="dark"] .card        { background: var(--bg-card); border-color: var(--bd-color); }
[data-theme="dark"] .alert       { border-color: var(--bd-color); }

/* ═══════════════════════════════════════════════════════════════
   DJANGO MESSAGES
═══════════════════════════════════════════════════════════════ */
.django-messages {
    position: fixed;
    top: 78px;
    right: 18px;
    z-index: 9999;
    min-width: 300px;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp .55s ease forwards; }

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fade-in { animation: fadeIn .4s ease forwards; }

/* ═══════════════════════════════════════════════════════════════
   BACK TO TOP
═══════════════════════════════════════════════════════════════ */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--brand-red);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .3s, visibility .3s, transform .3s, background .2s;
    box-shadow: 0 4px 16px rgba(200, 16, 46, .4);
}

.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover   { background: var(--brand-red-hover); transform: translateY(-2px); }

/* ═══════════════════════════════════════════════════════════════
   PRELOADER
═══════════════════════════════════════════════════════════════ */
.preloader {
    position: fixed;
    inset: 0;
    background: var(--nav-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity .4s, visibility .4s;
}

.preloader.hidden { opacity: 0; visibility: hidden; }

.preloader-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -2px;
}

.preloader-logo span { color: var(--brand-red); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .navbar-kab .nav-link { padding: 11px 14px !important; }
    .navbar-kab .nav-link::after { display: none; }

    .sec-title,
    .section-title { font-size: 1.7rem; }

    .page-header { padding: 48px 0 36px; }
}

@media (max-width: 576px) {
    .django-messages { left: 12px; right: 12px; min-width: unset; }
}
