/* ===================================================
   ESTILOS PÚBLICOS DO e-SIC
   Sistema Eletrônico do Serviço de Informação ao Cidadão
   IMPORTANTE: Todos os seletores têm alta especificidade
   para NÃO afetar o layout do portal
   =================================================== */

/* Page Header - APENAS dentro do .page-header */
.page-header {
    background: var(--gradient-hero, linear-gradient(135deg, #5b8fff 0%, #0d4fd9 100%));
    padding: 60px 0 40px;
    color: white;
    margin-bottom: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.page-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-header .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.95;
}

.page-header .breadcrumb a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.page-header .breadcrumb a:hover {
    opacity: 0.8;
    text-decoration: none;
}

.page-header .breadcrumb span {
    opacity: 0.7;
}

.page-header h1 {
    font-size: 42px;
    margin-bottom: 12px;
    font-weight: 700;
    color: white;
}

.page-header .subtitle {
    font-size: 18px;
    opacity: 0.95;
    color: white;
}

/* Cards - APENAS elementos com classe .card */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Card como link */
a.card {
    display: block;
    color: inherit;
    text-decoration: none !important;
}

a.card:hover {
    text-decoration: none !important;
}

/* Form Controls - APENAS elementos com classe .form-control */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    color: #2d3748;
    background-color: white;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary, #2c5aa0);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.form-control::placeholder {
    color: #a0aec0;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232d3748' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

/* Buttons - APENAS elementos com classe .btn */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    line-height: 1.5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    text-decoration: none !important;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--gradient-hero, linear-gradient(135deg, #5b8fff 0%, #0d4fd9 100%));
    color: white !important;
}

.btn-primary:hover {
    color: white !important;
}

.btn-secondary {
    background: #e2e8f0;
    color: #2d3748 !important;
}

.btn-secondary:hover {
    background: #cbd5e0;
    color: #2d3748 !important;
}

.btn i {
    margin-right: 8px;
}

/* Grid System - APENAS elementos com classe .row */
.row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.row.gap-small {
    gap: 12px;
}

.row.gap-large {
    gap: 32px;
}

/* Responsive columns */
@media (min-width: 768px) {
    .row {
        grid-template-columns: repeat(12, 1fr);
    }

    .col-md-12 {
        grid-column: span 12;
    }

    .col-md-6 {
        grid-column: span 6;
    }

    .col-md-4 {
        grid-column: span 4;
    }

    .col-md-3 {
        grid-column: span 3;
    }
}

@media (max-width: 767px) {
    .row > * {
        grid-column: span 12;
    }
}

/* Labels - APENAS dentro de forms com .card */
.card label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

.card label .required,
.card label .text-danger {
    color: #e53e3e;
}

/* Small text - APENAS dentro de .card */
.card small {
    font-size: 13px;
    color: #718096;
    line-height: 1.4;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid;
}

.alert-info {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #0d47a1;
}

.alert-success {
    background: #e6ffed;
    border-color: #28a745;
    color: #155724;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert-danger {
    background: #fee;
    border-color: #dc3545;
    color: #721c24;
}

/* Checkbox - APENAS dentro de .card */
.card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    line-height: 1.5;
}

.badge-info {
    background: #2196f3;
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #856404;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

/* Timeline (para histórico de tramitação) */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 8px;
    bottom: -24px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-icon {
    position: absolute;
    left: -40px;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 40px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 40px; }

.p-3 { padding: 24px; }
.p-4 { padding: 32px; }
.p-5 { padding: 40px; }

/* Responsive - APENAS .page-header */
@media (max-width: 768px) {
    .page-header {
        padding: 40px 0 30px;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .page-header .subtitle {
        font-size: 16px;
    }

    .btn {
        width: 100%;
        padding: 14px 20px;
    }

    .form-control {
        font-size: 16px; /* Previne zoom no iOS */
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Focus visible for accessibility - APENAS .btn e .form-control */
.btn:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--primary, #2c5aa0);
    outline-offset: 2px;
}

/* Disable text decoration on buttons and cards */
button,
button:hover,
button:focus,
input[type="submit"],
input[type="button"],
.btn,
.btn:hover,
.btn:focus,
a.btn,
a.btn:hover,
a.card,
a.card:hover {
    text-decoration: none !important;
}

/* Additional utility classes */
.text-danger, .required {
    color: #e53e3e;
}

.text-muted {
    color: #718096;
}

.text-success {
    color: #28a745;
}

.text-warning {
    color: #ffc107;
}

/* Download/attachment links */
a.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 2px solid #28a745;
    border-radius: 6px;
    color: #28a745;
    text-decoration: none !important;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

a.attachment-link:hover {
    background: #28a745;
    color: white;
    text-decoration: none !important;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

/* Flexbox utilities */
.flex {
    display: flex;
}

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

.gap-2 {
    gap: 16px;
}

.gap-3 {
    gap: 24px;
}

/* Width utilities */
.w-full {
    width: 100%;
}

/* ===================================================
   CLASSES ESPECÍFICAS DO e-SIC (prefixadas)
   =================================================== */

.esic-banner {
    background: var(--gradient-hero-soft, linear-gradient(135deg, #7ea1ff 0%, #1f69ff 100%));
    border-radius: 12px;
    padding: 40px;
    color: white;
    margin-bottom: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.esic-banner-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

.esic-banner-icon {
    font-size: 72px;
    opacity: 0.9;
    flex-shrink: 0;
}

.esic-banner-text h2 {
    color: white;
    margin-bottom: 16px;
    font-size: 32px;
}

.esic-banner-text p {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.esic-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.esic-action-card {
    display: block;
    text-decoration: none !important;
    padding: 40px 32px;
    border-radius: 12px;
    color: white;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.esic-action-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-decoration: none !important;
}

.esic-action-card.card-1 {
    background: var(--gradient-hero, linear-gradient(135deg, #5b8fff 0%, #0d4fd9 100%));
}

.esic-action-card.card-2 {
    background: var(--gradient-hero-soft, linear-gradient(135deg, #7ea1ff 0%, #1f69ff 100%));
}

.esic-action-card.card-3 {
    background: var(--gradient-hero-contrast, linear-gradient(135deg, #1f69ff 0%, #0641b8 100%));
}

.esic-action-icon {
    font-size: 56px;
    margin-bottom: 20px;
    display: block;
}

.esic-action-title {
    color: white;
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 700;
}

.esic-action-desc {
    font-size: 16px;
    opacity: 0.95;
    margin: 0;
}

.esic-stats-section {
    background: #f7fafc;
    border-radius: 12px;
    padding: 50px 40px;
    margin-bottom: 60px;
}

.esic-stats-title {
    text-align: center;
    margin-bottom: 40px;
    color: #2d3748;
    font-size: 32px;
    font-weight: 700;
}

.esic-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.esic-stat-item {
    text-align: center;
}

.esic-stat-icon-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.esic-stat-icon-circle.circle-1 {
    background: var(--gradient-hero, linear-gradient(135deg, #5b8fff 0%, #0d4fd9 100%));
}

.esic-stat-icon-circle.circle-2 {
    background: var(--gradient-hero-soft, linear-gradient(135deg, #7ea1ff 0%, #1f69ff 100%));
}

.esic-stat-icon-circle.circle-3 {
    background: var(--gradient-hero-contrast, linear-gradient(135deg, #1f69ff 0%, #0641b8 100%));
}

.esic-stat-icon-circle i {
    font-size: 40px;
    color: white;
}

.esic-stat-number {
    font-size: 48px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.esic-stat-label {
    font-size: 16px;
    color: #4a5568;
}

.esic-cta-section {
    margin-top: 60px;
    padding-top: 50px;
    border-top: 3px solid #e2e8f0;
    text-align: center;
}

.esic-cta-title {
    color: #2d3748;
    font-size: 28px;
    margin-bottom: 30px;
}

.esic-cta-button {
    display: inline-block;
    background: var(--gradient-hero, linear-gradient(135deg, #5b8fff 0%, #0d4fd9 100%));
    color: white !important;
    padding: 18px 40px;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.esic-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    text-decoration: none !important;
}

.esic-cta-button i {
    margin-right: 8px;
}

@media (max-width: 768px) {
    .esic-banner {
        padding: 30px 20px;
    }

    .esic-banner-content {
        flex-direction: column;
        text-align: center;
    }

    .esic-banner-icon {
        font-size: 56px;
    }

    .esic-banner-text h2 {
        font-size: 24px;
    }

    .esic-banner-text p {
        font-size: 16px;
    }

    .esic-actions-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .esic-stats-section {
        padding: 30px 20px;
    }

    .esic-stats-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .esic-stat-number {
        font-size: 36px;
    }

    .esic-cta-button {
        padding: 14px 28px;
        font-size: 16px;
    }
}
