/* =========================================================
   CaronaCondo - Main Stylesheet
   Colors: #0066FF (Light Blue) | #001133 (Dark Blue) | #F4F6F8 (Cinza Claro)
   ========================================================= */

/* --- Variables --- */
:root {
    --primary:       #0066FF;
    --primary-dark:  #0055CC;
    --secondary:     #001133;
    --accent:        #F0B429;
    --bg:            #F4F6F8;
    --bg-white:      #FFFFFF;
    --text:          #1e293b;
    --text-muted:    #64748b;
    --border:        #e2e8f0;
    --shadow-sm:     0 4px 12px rgba(0,17,51,0.1);
    --shadow-md:     0 12px 40px rgba(0,17,51,0.15);
    --shadow-lg:     0 30px 80px rgba(0,17,51,0.25);
    --radius:        16px;
    --radius-sm:     10px;
    --radius-xs:     6px;
    --transition:    all 0.25s cubic-bezier(0.4,0,0.2,1);
    --font:          'Inter', system-ui, -apple-system, sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(0,102,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,102,255,0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    color: var(--text);
    min-height: 100vh;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* --- AUTH LAYOUT --- */
.auth-body {
    background: linear-gradient(135deg, var(--primary) 0%, #ffffff 100%);
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--bg-white);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.5s ease;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 8px 24px rgba(0,102,255,0.35);
}

.auth-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Tab Toggle */
.auth-tabs {
    display: flex;
    background: var(--bg);
    border-radius: 50px;
    padding: 4px;
    margin-bottom: 1.75rem;
}

.auth-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.auth-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0,102,255,0.3);
}

.auth-tab:hover:not(.active) {
    color: var(--primary);
}

/* Form Elements */
.form-label-sm {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    border: 1px solid #9ca3af;
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--text);
    transition: var(--transition);
    background-color: var(--bg-white);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,102,255,0.15);
    outline: none;
}

.form-control::placeholder { color: #9ca3af; }

.input-group > .form-control:first-child { border-right: none; }
.input-group > .form-control:not(:first-child) { border-left: none; }
.input-group-text { border: 1px solid #9ca3af; background-color: var(--bg-white); }
.input-group > .input-group-text:first-child { border-right: none; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .input-group-text:not(:first-child) { border-left: none; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group .btn-outline-secondary {
    border-color: #9ca3af;
    border-left: none;
    color: var(--text-muted);
    background: var(--bg-white);
}
.input-group .btn-outline-secondary:hover { color: var(--primary); }

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-weight: 700;
    font-size: 0.9375rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0,102,255,0.3);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    width: 100%;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,102,255,0.4);
    color: white;
}

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

.btn-outline-custom {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 50px;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-outline-custom:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.forgot-link {
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.forgot-link:hover { color: var(--secondary); text-decoration: underline; }

/* Divider */
.divider-text {
    position: relative;
    text-align: center;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.divider-text::before, .divider-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.divider-text::before { left: 0; }
.divider-text::after  { right: 0; }

/* Alert Messages */
.alert-cc {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-cc-error {
    background: #fef2f2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.alert-cc-success {
    background: #f0fdf4;
    color: #16a34a;
    border-left: 4px solid #16a34a;
}

/* --- NAVBAR --- */
#mainNav {
    background: linear-gradient(135deg, var(--secondary), #0a3d48);
    box-shadow: 0 2px 20px rgba(0,17,51,0.25);
    padding: 0.6rem 0;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
}

.navbar-brand { font-size: 1.2rem; color: white !important; font-weight: 700; }

.nav-link {
    color: rgba(255,255,255,0.8) !important;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
    border-radius: var(--radius-xs);
    padding: 0.4rem 0.75rem !important;
}

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

.nav-icon-btn {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-size: 1rem;
    position: relative;
}

.nav-icon-btn:hover { background: rgba(255,255,255,0.2); color: white; }

.badge-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--secondary);
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    transition: var(--transition);
}

.avatar-sm:hover { border-color: var(--primary); }

/* --- CARDS --- */
.card-cc {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card-cc:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.card-cc-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-cc-body { padding: 1.5rem; }

/* Stats Cards */
.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    margin-bottom: 1rem;
}

.stat-icon-primary { background: rgba(0,102,255,0.12); color: var(--primary); }
.stat-icon-secondary { background: rgba(0,17,51,0.1); color: var(--secondary); }
.stat-icon-warning { background: rgba(240,180,41,0.15); color: #d97706; }
.stat-icon-danger { background: rgba(239,68,68,0.12); color: #dc2626; }

.stat-value {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Carona Cards */
.carona-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.carona-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.carona-card-header {
    background: linear-gradient(135deg, var(--secondary), #0a3d48);
    padding: 1.25rem 1.5rem;
    color: white;
}

.carona-route {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

.route-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.route-dot.end { background: var(--accent); }

.route-line {
    width: 2px;
    height: 28px;
    background: rgba(255,255,255,0.3);
    margin-left: 5px;
}

/* Avatar */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}

.avatar-lg { width: 80px; height: 80px; }
.avatar-md { width: 52px; height: 52px; }
.avatar-xs { width: 32px; height: 32px; border-width: 2px; }

/* Badges */
.badge-cc {
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-primary { background: rgba(0,102,255,0.15); color: var(--primary); }
.badge-secondary { background: rgba(0,17,51,0.1); color: var(--secondary); }
.badge-success { background: rgba(22,163,74,0.12); color: #16a34a; }
.badge-warning { background: rgba(240,180,41,0.15); color: #d97706; }
.badge-danger { background: rgba(239,68,68,0.12); color: #dc2626; }
.badge-info { background: rgba(59,130,246,0.12); color: #2563eb; }

/* Stars */
.stars { color: var(--accent); font-size: 0.875rem; }

/* Gradient headings */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Section heading */
.section-heading {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

/* Page header */
.page-header {
    background: linear-gradient(135deg, var(--secondary) 0%, #0a3d48 100%);
    border-radius: var(--radius);
    padding: 2rem;
    color: white;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(0,102,255,0.15);
}

.page-header::after {
    content: '';
    position: absolute;
    right: 40px;
    bottom: -60px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(0,102,255,0.1);
}

/* Chat */
.chat-container {
    height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.msg-bubble {
    max-width: 70%;
    padding: 0.65rem 1rem;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
}

.msg-sent {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.msg-received {
    background: white;
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.msg-time {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 0.25rem;
    text-align: right;
}

/* Online indicator */
.online-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

/* Progress bars */
.progress-cc {
    height: 6px;
    border-radius: 50px;
    background: var(--border);
    overflow: hidden;
}

.progress-cc-bar {
    height: 100%;
    border-radius: 50px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.6s ease;
}

/* Toast notifications */
.toast-cc {
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
}

/* Type selector */
.tipo-selector { display: flex; gap: 1rem; }

.tipo-card {
    flex: 1;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
}

.tipo-card:hover { border-color: var(--primary); background: rgba(0,102,255,0.03); }
.tipo-card.selected { border-color: var(--primary); background: rgba(0,102,255,0.06); }
.tipo-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.875rem;
}

.tipo-card-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: block;
}

.tipo-card h6 { font-weight: 700; margin: 0; font-size: 0.9rem; color: var(--secondary); }
.tipo-card small { color: var(--text-muted); font-size: 0.75rem; }

/* Sidebar nav */
.sidebar {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem 1rem;
    border: 1px solid var(--border);
    position: sticky;
    top: 80px;
}

.sidebar-nav { list-style: none; padding: 0; margin: 0; }

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.sidebar-nav li a:hover, .sidebar-nav li a.active {
    background: rgba(0,102,255,0.1);
    color: var(--primary);
}

.sidebar-nav li a i { font-size: 1.1rem; }

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.7; transform: scale(0.9); }
}

@keyframes pulse-btn {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.4); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(0, 102, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 102, 255, 0); }
}
.animate-pulse-btn {
    animation: pulse-btn 2s infinite;
}

@keyframes slideIn {
    from { transform: translateX(-10px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.animate-fadeInUp { animation: fadeInUp 0.5s ease both; }
.animate-delay-1  { animation-delay: 0.1s; }
.animate-delay-2  { animation-delay: 0.2s; }
.animate-delay-3  { animation-delay: 0.3s; }

/* Utilities */
.fw-800 { font-weight: 800; }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }

.text-primary-cc  { color: var(--primary) !important; }
.text-secondary-cc { color: var(--secondary) !important; }
.bg-primary-cc    { background-color: var(--primary) !important; }
.bg-secondary-cc  { background-color: var(--secondary) !important; }

.gap-3 { gap: 1rem; }

/* Responsive */
@media (max-width: 768px) {
    .auth-card { padding: 2rem 1.25rem; }
    .section-heading { font-size: 1.375rem; }
    .stat-value { font-size: 1.5rem; }
    .page-header { padding: 1.5rem; }
    .tipo-selector { gap: 0.5rem; }
    .tipo-card { padding: 0.75rem 0.5rem; }
    .tipo-card-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
    .tipo-card h6 { font-size: 0.8rem; }
    .tipo-card small { font-size: 0.65rem; }
    .sidebar { position: static; }
    .msg-bubble { max-width: 85%; }
}

@media (max-width: 480px) {
    .auth-card { padding: 1.75rem 1rem; border-radius: 18px; }
}

/* Dropdown */
.dropdown-menu {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-md) !important;
    min-width: 200px;
}

.dropdown-item {
    font-size: 0.875rem;
    padding: 0.6rem 1rem;
    font-weight: 500;
    transition: var(--transition);
}

.dropdown-item:hover { background: rgba(0,102,255,0.08); color: var(--primary); }

/* Table */
.table-cc th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.table-cc td { vertical-align: middle; font-size: 0.875rem; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
