/* === Identidade Ágili Pesquisas === */
:root {
    --primary: #005ea5;
    --primary-dark: #004080;
    --secondary: #5DA6D6;
    --light-bg: #F4F7FA;
    --dark-text: #222;
    --accent: #FFD600;
    --accent-dark: #e6c100;
    --text-light: #fff;
    --border-color: #e3e8ee;
    --danger: #dc3545;
    --success: #198754;
}

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&family=Montserrat:wght@400;600;700;800&display=swap');

* { box-sizing: border-box; }

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--dark-text);
    background: var(--light-bg);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* === Botões === */
.btn-primary-agili,
.btn-outline-agili,
.btn-danger-agili {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .65rem 1.4rem;
    border-radius: 6px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    border: 2px solid transparent;
    transition: all .2s;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.4;
}

.btn-primary-agili {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary-agili:hover, .btn-primary-agili:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-agili {
    background: #fff;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-agili:hover, .btn-outline-agili:focus {
    background: var(--primary);
    color: #fff;
}

.btn-danger-agili {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger-agili:hover, .btn-danger-agili:focus {
    background: #b32533;
    border-color: #b32533;
    color: #fff;
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--accent);
    color: var(--dark-text);
    border: none;
    border-radius: 50px;
    padding: .75rem 2rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: transform .2s, background .2s;
}
.btn-accent:hover { background: var(--accent-dark); transform: scale(1.03); color: var(--dark-text); }

/* === Login (cliente e admin) === */
.login-wrapper {
    min-height: 100vh;
    display: flex;
}
.login-banner {
    flex: 1;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
}
.login-banner::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 6px;
    background: var(--accent);
}
.login-banner-inner { max-width: 420px; text-align: center; }
.login-banner img { max-width: 240px; margin-bottom: 2rem; filter: brightness(0) invert(1); }
.login-banner h2 {
    color: #fff;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}
.login-banner p { font-size: 1rem; opacity: .9; }

.login-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #fff;
}
.login-form-inner { width: 100%; max-width: 460px; }
.login-form-inner h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
}
.login-form-inner h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: .5rem auto 0;
    border-radius: 2px;
}

.form-floating > .form-control:focus,
.form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 .2rem rgba(93, 166, 214, .25);
}

.disclaimer {
    margin-bottom: .6rem;
    font-size: .85rem;
    padding-left: 2.2em;
}
.disclaimer .form-check-label { font-style: italic; color: #555; cursor: pointer; }
.disclaimer .form-check-input {
    width: 1.4em;
    height: 1.4em;
    margin-left: -2.2em;
    margin-top: .1em;
    border: 2px solid var(--primary);
    cursor: pointer;
}
.disclaimer .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.disclaimer .form-check-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 .2rem rgba(0, 94, 165, .25);
}

@media (max-width: 768px) {
    .login-banner { display: none; }
    .login-form { padding: 1.5rem; }
}

/* === Toggle "olho" para campos de senha === */
.input-eye-wrap { position: relative; }
.form-floating.input-eye-wrap .form-control,
.input-eye-wrap > input.form-control {
    padding-right: 44px;
}
.btn-eye {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #888;
    z-index: 5;
    cursor: pointer;
}
.btn-eye:hover, .btn-eye:focus { color: var(--primary); outline: none; }

/* === Topbar / Navbar === */
.topbar-agili {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.topbar-agili .brand { display: flex; align-items: center; gap: .75rem; }
.topbar-agili .brand img { height: 42px; }
.topbar-agili .brand-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.topbar-agili .brand-text small {
    display: block;
    color: #888;
    font-weight: 400;
    font-size: .75rem;
    margin-top: 2px;
}
.topbar-agili .user-info {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .9rem;
}

/* Dropdown do usuário (substitui botões soltos) */
.user-toggle {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem 1rem;
    border-radius: 6px;
    color: var(--dark-text);
    font-weight: 600;
    font-size: .9rem;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all .2s;
    font-family: 'Open Sans', sans-serif;
}
.user-toggle i.fa-user-shield, .user-toggle i.fa-user { color: var(--primary); }
.user-toggle:hover, .user-toggle[aria-expanded="true"] {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.user-toggle:hover i, .user-toggle[aria-expanded="true"] i { color: #fff; }
.user-toggle::after { display: none; }
.user-toggle .chev { font-size: .75rem; opacity: .7; }

.dropdown-menu .dropdown-item {
    padding: .55rem 1rem;
    font-size: .9rem;
}
.dropdown-menu .dropdown-item i { width: 18px; text-align: center; }

/* === Sidebar === */
.layout-wrap { display: flex; min-height: calc(100vh - 70px); }
.sidebar-agili {
    width: 240px;
    background: var(--primary);
    color: #fff;
    padding: 1.5rem 0;
    flex-shrink: 0;
}
.sidebar-agili .sidebar-heading {
    padding: 0 1.5rem;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.6);
    margin-bottom: .75rem;
}
.sidebar-agili a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1.5rem;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background .2s, border-color .2s;
}
.sidebar-agili a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-agili a.active {
    background: rgba(255,255,255,.12);
    color: #fff;
    border-left-color: var(--accent);
}
.sidebar-agili a i { width: 20px; text-align: center; }

.main-area {
    flex: 1;
    padding: 2rem;
    overflow-x: auto;
}
.main-area-full { max-width: 1280px; margin: 0 auto; width: 100%; }

/* Logo clicável no topbar */
.brand-link { text-decoration: none; color: inherit; }
.brand-link:hover .brand-text { color: var(--primary); }
.brand-link .brand-text { transition: color .2s; }

@media (max-width: 768px) {
    .layout-wrap { flex-direction: column; }
    .sidebar-agili { width: 100%; padding: .5rem 0; }
    .sidebar-agili a { padding: .5rem 1rem; }
    .main-area { padding: 1rem; }
}

/* === Cards === */
.card-stat {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    padding: 1.5rem;
    transition: transform .2s, box-shadow .2s;
}
.card-stat:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.card-stat .stat-number {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    color: var(--primary);
    line-height: 1;
}
.card-stat .stat-label {
    color: #777;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: .5rem;
}
.card-stat .stat-icon {
    float: right;
    font-size: 2.5rem;
    color: var(--accent);
    opacity: .6;
}

/* Card clicável (vira link de navegação) */
a.card-stat {
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    border-left: 4px solid transparent;
}
a.card-stat:hover {
    color: inherit;
    border-left-color: var(--accent);
}
a.card-stat .stat-go {
    position: absolute;
    bottom: 1rem;
    right: 1.25rem;
    color: var(--primary);
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    opacity: 0;
    transition: opacity .2s;
}
a.card-stat:hover .stat-go { opacity: 1; }
a.card-stat .stat-sub { color: #999; font-size: .8rem; margin-top: .35rem; }

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: .5rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 50px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* === Tabela === */
.table-agili {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.table-agili thead {
    background: var(--primary);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.table-agili thead th { border: none; padding: 1rem; }
.table-agili tbody td { padding: .75rem 1rem; vertical-align: middle; border-color: var(--border-color); }
.table-agili tbody tr:hover { background: var(--light-bg); }

/* === Form Card === */
.form-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    margin-bottom: 1.5rem;
}

/* === Pesquisa Card (cliente) === */
.pesquisa-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    transition: transform .2s, box-shadow .2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}
.pesquisa-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
    color: inherit;
}
.pesquisa-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.pesquisa-card h5 {
    color: var(--primary);
    margin-bottom: .25rem;
    font-size: 1rem;
}
.pesquisa-card .sub { color: #888; font-size: .8rem; }

.pesquisa-card.active {
    border: 2px solid var(--accent);
}

/* === Iframe viewer === */
.viewer-wrap {
    height: calc(100vh - 70px);
    width: 100%;
}
.viewer-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* === Status pills === */
.pill {
    display: inline-block;
    padding: .25rem .75rem;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.pill-success { background: #d1f4e0; color: #0a6c3b; }
.pill-danger { background: #fdd9dc; color: #8e1c28; }
.pill-info { background: #d4e8f7; color: #0d4d80; }

/* === Alerts === */
.alert-agili {
    border-radius: 6px;
    border: none;
    padding: .75rem 1rem;
}

/* === Footer mini === */
.footer-mini {
    text-align: center;
    color: #999;
    font-size: .8rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.footer-mini a { color: var(--primary); text-decoration: none; }
