/* 
 * Sistema de Chamados FCAS - Premium Modern Theme
 * Design Philosophy: Vibrant, Professional, Glassmorphism, Dynamic.
 */

:root {
    /* Brand Identity Colors */
    --primary-color: #07224D;
    /* Downriver - Deep Blue */
    --primary-light: #1a3b6e;
    /* Lighter shade for gradients */
    --accent-color: #CA5D32;
    /* Tuscany - Orange/Redish */
    --accent-hover: #b04b25;
    /* Darker Tuscany */
    --accent-glow: rgba(202, 93, 50, 0.4);

    /* Backgrounds */
    --bg-body: #F6FAFD;
    /* Polar - Light Blueish White */
    --bg-card: rgba(255, 255, 255, 0.85);
    /* Glass Effect Base */
    --bg-input: rgba(255, 255, 255, 0.9);

    /* Text Colors */
    --text-main: #07224D;
    /* Main text matches primary for cohesion */
    --text-body: #334155;
    /* Slate 700 for paragraphs */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #94a3b8;
    /* Slate 400 */
    --text-white: #ffffff;

    /* Functional Colors */
    --success-bg: #dcfce7;
    --success-text: #14532d;
    --warning-bg: #fef9c3;
    --warning-text: #854d0e;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --info-bg: #e0f2fe;
    --info-text: #075985;

    /* Borders & Shadows */
    --border-glass: 1px solid rgba(255, 255, 255, 0.6);
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Premium Shadows */
    --shadow-sm: 0 2px 4px rgba(7, 34, 77, 0.05);
    --shadow-md: 0 8px 16px -4px rgba(7, 34, 77, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(7, 34, 77, 0.1), 0 10px 10px -5px rgba(7, 34, 77, 0.04);
    --shadow-glow: 0 0 15px var(--accent-glow);
}

/* === Global Reset & Typography === */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    /* Subtle mesh gradient background */
    background-image:
        radial-gradient(at 0% 0%, rgba(7, 34, 77, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(202, 93, 50, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-body);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* === Glassmorphism Utilities === */
.glass-effect {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--border-glass);
    box-shadow: var(--shadow-md);
}

/* === Header === */
.header-fcas {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding: 1.5rem 0;
    margin-bottom: 3rem;
    box-shadow: 0 4px 20px rgba(7, 34, 77, 0.15);
    color: var(--text-white);
    position: relative;
    overflow: hidden;
}

/* Decorative subtle glow in header */
.header-fcas::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(202, 93, 50, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

.logo-fcas {
    width: 64px;
    height: 64px;
    background: white;
    border-radius: var(--radius-md);
    padding: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.logo-fcas:hover {
    transform: scale(1.05) rotate(-2deg);
}

.logo-fcas img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.titulo-sistema h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.titulo-sistema p {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

/* === Main Container === */
.container-principal {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    width: 100%;
    flex: 1;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Cards === */
.card,
.card-formulario,
.nav-card,
.card-login {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-formulario,
.card-login {
    padding: 3rem;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* Decorative top bar for cards */
.card-formulario::before,
.card-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

/* Navigation Cards (Home) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.nav-card {
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    text-decoration: none;
    color: var(--text-body);
    height: 100%;
    align-items: flex-start;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.nav-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    background: white;
}

.nav-card:hover::after {
    width: 100%;
}

.icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    background-color: #ecf3fa;
    /* Light tint of primary */
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.nav-card:hover .icon-wrapper {
    background: linear-gradient(135deg, var(--accent-color), #d96d3f);
    color: white;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 16px rgba(202, 93, 50, 0.25);
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.card-desc {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    flex-grow: 1;
    line-height: 1.6;
}

.btn-action {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.2s ease;
}

.nav-card:hover .btn-action {
    gap: 0.75rem;
}

/* === Forms === */
.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-main);
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(202, 93, 50, 0.1);
    background-color: white;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* === Buttons === */
.btn-primary,
.btn-enviar,
.btn-entrar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, #b84a22 100%);
    color: white;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(202, 93, 50, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.btn-primary:hover,
.btn-enviar:hover,
.btn-entrar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(202, 93, 50, 0.3);
    background: linear-gradient(135deg, #d96d3f 0%, #a83f1a 100%);
}

.btn-voltar-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    transition: color 0.2s;
}

.btn-voltar-home:hover {
    color: var(--accent-color);
}

/* === Progress Bar (Premium) === */
.progress-container {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
}

.progress-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
}

.progress-bar-container {
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(202, 93, 50, 0.3);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.progress-step {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    position: relative;
}

.progress-step.active {
    color: var(--accent-color);
    font-weight: 700;
}

/* === Badges & Status === */
.badge {
    padding: 0.5em 1em;
    font-size: 0.75em;
    font-weight: 700;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bg-warning,
.status-aberto {
    background-color: #fff7ed !important;
    color: #c2410c !important;
    /* Orange-700 */
    border: 1px solid #ffedd5;
}

.bg-info,
.status-progresso {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    /* Blue-700 */
    border: 1px solid #dbeafe;
}

.bg-success,
.status-concluido {
    background-color: #f0fdf4 !important;
    color: #15803d !important;
    /* Green-700 */
    border: 1px solid #dcfce7;
}

/* === Footer === */
.footer {
    text-align: center;
    padding: 2.5rem;
    border-top: 1px solid var(--border-color);
    background-color: white;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* === Utility Classes === (Retained for Layout) */
.text-center {
    text-align: center;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -1rem;
}

.col-md-6,
.col-md-12 {
    padding: 0 1rem;
    box-sizing: border-box;
}

.col-md-12 {
    width: 100%;
}

.col-md-6 {
    width: 100%;
}

@media (min-width: 768px) {
    .col-md-6 {
        width: 50%;
    }

    .header-content {
        justify-content: flex-start;
    }
}

/* Responsive Tweaks */
@media (max-width: 768px) {
    .card-formulario {
        padding: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .titulo-sistema h1 {
        font-size: 1.25rem;
    }
}

/* === Acompanhar Chamado (Tracking Page) === */
.card-consulta {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 3rem;
    margin: 0 auto;
    max-width: 800px;
    position: relative;
    overflow: hidden;
}

.card-consulta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
}

.input-group-consulta {
    display: flex;
    gap: 0.5rem;
}

.btn-consultar {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0 1.5rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-consultar:hover {
    background-color: var(--primary-light);
}

.ticket-result {
    margin-top: 2rem;
    display: none;
    /* JS will show this */
    animation: fadeIn 0.4s ease-out;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid white;
    margin-bottom: 2rem;
}

.ticket-id {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.025em;
}

.badge-status {
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.tecnico-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.tecnico-avatar {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item {
    background: rgba(255, 255, 255, 0.5);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.info-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.info-value {
    font-weight: 600;
    color: var(--text-main);
}