/* ===================================================================
   Portal do Colaborador — public.css
   Estrutura fiel ao SPA index.html
   Escopado dentro de .colab-wrapper
   =================================================================== */

/* Inter font (fallback quando não carregado pelo template) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Reset básico dentro do wrapper --- */
.colab-wrapper *,
.colab-wrapper *::before,
.colab-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.colab-wrapper [hidden] {
    display: none !important;
}

/* ===================================================================
   WRAPPER PRINCIPAL
   =================================================================== */
.colab-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #31333A;
    background-color: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ===================================================================
   HEADER / TOPBAR (bg-corporate-900 do SPA)
   =================================================================== */
.colab-topbar {
    background-color: #222429;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.colab-topbar-inner {
    max-width: 768px;
    margin: 0 auto;
    padding: 0 16px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.colab-topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.colab-topbar-icon {
    width: 34px;
    height: 34px;
    background-color: #d97706;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.2);
    color: #fff;
    font-size: .9rem;
    flex-shrink: 0;
}

.colab-topbar-badge {
    font-size: .75rem;
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.colab-topbar-badge i {
    color: #F5A800;
}

/* ===================================================================
   MAIN — ÁREA DAS VIEWS
   =================================================================== */
.colab-main {
    flex: 1;
    max-width: 768px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 16px 60px;
    position: relative;
}

/* ===================================================================
   VIEWS (SPA logic: uma por vez)
   ALTA ESPECIFICIDADE para sobrescrever reset do tema
   =================================================================== */
.colab-wrapper .colab-view {
    transition: opacity .45s ease, transform .45s ease;
}

.colab-wrapper .colab-view--active {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    animation: colabFadeIn .45s ease-out;
}

/* Ocultar completamente — display:none com !important */
.colab-wrapper .colab-view--hidden {
    display: none !important;
    opacity: 0 !important;
    transform: translateY(16px) !important;
}

/* Estado intermediário durante transição (fade-out) */
.colab-wrapper .colab-view--out {
    display: block !important;
    opacity: 0 !important;
    transform: translateY(-12px) !important;
    pointer-events: none !important;
    transition: opacity .4s ease, transform .4s ease;
}

/* ===================================================================
   VIEW 1 — INTRO (título + subtítulo)
   =================================================================== */
.colab-view-intro {
    text-align: center;
    margin-bottom: 28px;
}

.colab-view-intro h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222429;
    margin-bottom: 6px;
    line-height: 1.25;
}

.colab-view-intro p {
    font-size: .875rem;
    color: #64748b;
}

/* ===================================================================
   CARD PRINCIPAL (formulário)
   =================================================================== */
.colab-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow:
        0 1px 3px rgba(0,0,0,.08),
        0 10px 40px -8px rgba(217,119,6,.15);
    border: 1px solid #e2e8f0;
    padding: 32px 36px;
}

/* ===================================================================
   GRID DE CAMPOS (2 colunas no SPA)
   =================================================================== */
.colab-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.colab-field--full {
    grid-column: 1 / -1;
}

/* ===================================================================
   CAMPOS
   =================================================================== */
.colab-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.colab-field label {
    font-size: .875rem;
    font-weight: 600;
    color: #334155;
}

.colab-required {
    color: #ef4444;
    margin-left: 2px;
}

.colab-field input[type="text"],
.colab-field input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    font-size: .9375rem;
    font-family: inherit;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #222429;
    transition: border-color .2s ease, box-shadow .2s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.colab-field input[type="text"]:focus,
.colab-field input[type="email"]:focus {
    border-color: #F5A800;
    box-shadow: 0 0 0 3px rgba(245,168,0,.2);
    background: #fff;
}

.colab-field input.colab-input-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

.colab-field-error {
    font-size: .78rem;
    color: #ef4444;
    font-weight: 500;
    display: block;
    min-height: 16px;
}

/* ===================================================================
   CAIXA DE DECLARAÇÃO (scroll interno — igual ao SPA)
   =================================================================== */
.colab-declaration-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    height: 192px;
    overflow-y: auto;
    margin-bottom: 24px;
    scroll-behavior: smooth;
}

.colab-declaration-box:focus {
    outline: 2px solid #F5A800;
    outline-offset: 2px;
}

.colab-declaration-title {
    font-size: .75rem;
    font-weight: 700;
    color: #31333A;
    text-transform: uppercase;
    letter-spacing: .08em;
    text-align: center;
    margin-bottom: 16px;
}

.colab-declaration-content {
    font-size: .875rem;
    color: #475569;
    line-height: 1.7;
}

.colab-declaration-content p {
    margin-bottom: 12px;
}

.colab-declaration-content p:last-child {
    margin-bottom: 0;
}

.colab-declaration-content strong {
    color: #1e293b;
}

/* Scrollbar personalizado */
.colab-declaration-box::-webkit-scrollbar { width: 6px; }
.colab-declaration-box::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
.colab-declaration-box::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.colab-declaration-box::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===================================================================
   CHECKBOX ACEITE (igual ao SPA — bg-brand-50/50 com hover)
   =================================================================== */
.colab-field--checkbox {
    margin-bottom: 8px;
}

.colab-acceptance {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #fef3c7;
    background: rgba(255, 251, 235, 0.5);
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.colab-acceptance:hover {
    background: #fffbeb;
    border-color: #fcd34d;
}

.colab-acceptance-check {
    padding-top: 2px;
    flex-shrink: 0;
}

.colab-acceptance input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    accent-color: #d97706;
    cursor: pointer;
}

.colab-acceptance span {
    font-size: .875rem;
    font-weight: 600;
    color: #31333A;
    line-height: 1.5;
    transition: color .2s ease;
}

.colab-acceptance:hover span {
    color: #b45309;
}

/* ===================================================================
   BOTÕES
   =================================================================== */
.colab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: .9375rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.colab-btn:focus-visible {
    outline: 3px solid #d97706;
    outline-offset: 3px;
}

.colab-btn:active:not(:disabled) {
    transform: translateY(1px);
}

/* Primary — amarelo âmbar */
.colab-btn--primary {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff;
    width: 100%;
    padding: 16px;
    font-size: 1.0625rem;
    box-shadow: 0 4px 16px rgba(217,119,6,.4);
    margin-top: 8px;
}

.colab-btn--primary:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(217,119,6,.55);
    transform: translateY(-1px);
}

.colab-btn--primary:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

.colab-btn--full {
    width: 100%;
}

/* Email / Comprovante button */
.colab-btn--email {
    background: linear-gradient(135deg, #F5A800 0%, #d97706 100%);
    color: #fff;
    width: 100%;
    box-shadow: 0 4px 16px rgba(217,119,6,.35);
    border: none;
}

.colab-btn--email:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 8px 24px rgba(217,119,6,.55);
    transform: translateY(-2px);
}

/* Dark button (corporate-800) */
.colab-btn--dark {
    background: #31333A;
    color: #fff;
    width: 100%;
    box-shadow: 0 2px 10px rgba(49,51,58,.3);
    transition: background .2s ease, box-shadow .2s ease, transform .15s ease;
}

.colab-btn--dark:hover {
    background: #111316;
    box-shadow: 0 8px 22px rgba(0,0,0,.4);
    transform: translateY(-2px);
}

/* Segurança note */
.colab-security-note {
    text-align: center;
    margin-top: 14px;
    font-size: .75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Estado de loading do botão */
.colab-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ===================================================================
   VIEW 2 — SUCESSO
   =================================================================== */
.colab-success-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 0;
}

.colab-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(16,185,129,.2);
    animation: colabBounce .5s cubic-bezier(.36,.07,.19,.97);
}

.colab-success-icon i {
    font-size: 2.25rem;
    color: #16a34a;
}

@keyframes colabBounce {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.colab-success-body h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #222429;
    margin-bottom: 12px;
}

.colab-success-msg {
    color: #475569;
    margin-bottom: 32px;
    max-width: 420px;
    font-size: .9375rem;
}

/* Protocolo card (igual ao SPA) */
.colab-protocol-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 32px;
    width: 100%;
    max-width: 440px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.colab-protocol-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.colab-protocol-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 12px 0;
}

.colab-protocol-label {
    font-weight: 600;
    color: #31333A;
    font-size: .875rem;
}

.colab-protocol-value {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: #d97706;
    background: #fffbeb;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: .875rem;
}

.colab-protocol-date {
    font-family: 'Courier New', Courier, monospace;
    color: #475569;
    font-size: .875rem;
}

/* Ações da tela de sucesso */
.colab-success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 440px;
}

/* ===================================================================
   VIEW 3 — ADMIN / RH
   =================================================================== */
.colab-admin-card {
    background: #222429;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    border: 1px solid #31333A;
    overflow: hidden;
    color: #fff;
    width: 100%;
}

.colab-admin-header {
    padding: 28px 32px;
    border-bottom: 1px solid #31333A;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.colab-admin-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #F5A800;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 6px;
}

.colab-admin-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.colab-admin-db-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #31333A;
    border: 1px solid #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #F5A800;
    box-shadow: inset 0 2px 6px rgba(0,0,0,.3);
    flex-shrink: 0;
}

.colab-admin-body {
    padding: 28px 32px;
}

.colab-admin-desc {
    color: #94a3b8;
    font-size: .875rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Log do banco de dados */
.colab-db-log {
    background: #31333A;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 32px;
    border: 1px solid #475569;
    font-family: 'Courier New', Courier, monospace;
    font-size: .875rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.colab-db-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #475569;
    flex-wrap: wrap;
    gap: 4px;
}

.colab-db-row--last {
    border-bottom: none;
    padding-bottom: 0;
}

.colab-db-key {
    color: #94a3b8;
    font-size: .8rem;
}

.colab-db-val {
    color: #fff;
    font-weight: 600;
    font-size: .875rem;
    text-align: right;
}

.colab-db-val--accent {
    color: #F5A800;
    font-weight: 700;
}

.colab-db-val--strong {
    font-weight: 700;
}

.colab-db-val--proto {
    color: #fcd34d;
    font-size: .8rem;
    word-break: break-all;
    text-align: right;
}

/* ===================================================================
   MODAL (comprovante / e-mail)
   =================================================================== */
.colab-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.colab-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(34, 36, 41, .65);
    backdrop-filter: blur(4px);
}

.colab-modal-content {
    position: relative;
    background: #f1f5f9;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 60px rgba(0,0,0,.25);
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    animation: colabScaleIn .3s cubic-bezier(.34,1.56,.64,1);
}

@keyframes colabScaleIn {
    from { transform: scale(.92); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* Barra SMTP simulado */
.colab-modal-smtp-bar {
    background: #31333A;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.colab-modal-smtp-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .875rem;
    font-weight: 600;
}

.colab-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color .15s, background .15s;
    display: flex;
    align-items: center;
}

.colab-modal-close:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
}

/* Cabeçalho recibo */
.colab-receipt-head {
    background: #fff;
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.colab-receipt-head-icon {
    width: 48px;
    height: 48px;
    background: #d97706;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    margin: 0 auto 14px;
    box-shadow: 0 4px 12px rgba(217,119,6,.35);
}

.colab-receipt-head h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #222429;
    margin-bottom: 4px;
}

.colab-receipt-head p {
    font-size: .8rem;
    color: #94a3b8;
}

/* Corpo do e-mail */
.colab-receipt-body {
    background: #fff;
    margin: 16px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.colab-receipt-greeting {
    font-size: .9rem;
    color: #334155;
    margin-bottom: 14px;
}

.colab-receipt-text {
    font-size: .875rem;
    color: #475569;
    margin-bottom: 16px;
    line-height: 1.6;
}

.colab-receipt-data {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.colab-receipt-data ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.colab-receipt-data li {
    font-size: .8rem;
    color: #334155;
}

.colab-receipt-proto {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: #b45309;
}

.colab-receipt-footer-note {
    font-size: .78rem;
    color: #94a3b8;
    font-style: italic;
    text-align: center;
}

/* Ação do modal */
.colab-receipt-actions {
    padding: 16px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 20px 20px;
}

/* ===================================================================
   TOASTS
   =================================================================== */
.colab-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.colab-toast {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: .875rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
    max-width: 340px;
    pointer-events: auto;
    animation: colabSlideIn .3s ease-out;
}

@keyframes colabSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.colab-toast.toast-success { background: #059669; }
.colab-toast.toast-error   { background: #dc2626; }
.colab-toast.toast-warning { background: #d97706; }
.colab-toast.toast-info    { background: #2563eb; }

/* ===================================================================
   ANIMAÇÕES SPA (fade + translate)
   =================================================================== */
@keyframes colabFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===================================================================
   RESPONSIVIDADE
   =================================================================== */
@media (max-width: 600px) {
    .colab-main {
        padding: 20px 12px 40px;
    }

    .colab-card {
        padding: 24px 20px;
    }

    .colab-fields-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .colab-field--full {
        grid-column: 1;
    }

    .colab-admin-header,
    .colab-admin-body {
        padding: 20px 20px;
    }

    .colab-db-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .colab-db-val {
        text-align: left;
    }

    .colab-db-val--proto {
        text-align: left;
    }

    .colab-success-body h2 {
        font-size: 1.5rem;
    }

    .colab-topbar-brand span {
        font-size: .95rem;
    }
}

/* ===================================================================
   PRINT
   =================================================================== */
@media print {
    .colab-topbar,
    .colab-modal-backdrop,
    .colab-modal-close,
    .colab-receipt-actions,
    .colab-toast-container {
        display: none !important;
    }

    .colab-modal-content {
        box-shadow: none;
        max-height: none;
    }
}
