/* OCA Global Corporate Stylesheet */
:root {
    /* Corporate Official Brand Colors */
    --oca-blue: #0B3356;
    --oca-blue-rgb: 11, 51, 86;
    --oca-red: #de473c;
    --oca-red-rgb: 222, 71, 60;
    --color-accent: #de473c;
    --color-accent-hover: #c93b31;
    --color-blue-950: #071e33;
    --color-blue-900: #0B3356;
    --color-blue-800: #14436d;
    --color-blue-700: #1e5485;

    /* Legacy compatibility tokens */
    --oca-navy: #0B3356;
    --oca-navy-dark: #071e33;
    --oca-sky: #00A3E0;
    --oca-sky-light: #E1F5FE;
    --oca-text: #1a202c;
    --oca-bg: #F8FAFC;
    --oca-border: #E2E8F0;
    --oca-success: #10B981;
    --oca-warning: #F59E0B;
    --oca-error: #EF4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--oca-bg);
    color: var(--oca-text);
}

/* ==========================================================================
   OFFICIAL OCA GLOBAL TOPBAR COMPONENT (Design System Standard)
   ========================================================================== */
.topbar, .navbar {
    background: var(--oca-blue, #0B3356);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0 1.5rem;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(11, 51, 86, 0.22);
    transition: min-height 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
}

/* Full horizontal SVG logo (default rest state) */
.brand-full {
    height: 30px;
    width: auto;
    display: block;
    transition: height 0.25s ease;
}

/* Isolated OCA Tick (collapsed state on scroll) */
.brand-mark {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.brand-mark svg {
    width: 22px;
    height: 18px;
    display: block;
}

.brand-title {
    font-size: 15px;
    color: #ffffff;
    letter-spacing: 0.01em;
    white-space: nowrap;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Dynamic scroll behavior: contracts header from 64px to 46px */
body.header-collapsed .topbar,
body.header-collapsed .navbar {
    min-height: 46px;
    padding: 0 1.25rem;
    box-shadow: 0 4px 16px rgba(11, 51, 86, 0.32);
}

body.header-collapsed .brand-full {
    display: none;
}

body.header-collapsed .brand-mark {
    display: inline-flex;
}

body.header-collapsed .brand-title .app-subtitle {
    display: none;
}

body.header-collapsed .brand-title .app-title {
    font-size: 14px;
}

/* Action items on the right side */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Status indicator pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    line-height: 1;
}

.status-pill-vertex {
    background-color: rgba(6, 78, 59, 0.85);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: #a7f3d0;
}

.status-pill-drive {
    background-color: rgba(12, 74, 110, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #bae6fd;
}

/* Corporate Language Switch (ES / EN) */
.lang-switch {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lang-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.lang-btn.active {
    background: var(--color-accent, #de473c);
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   FORM AND INTERACTIVE COMPONENTS
   ========================================================================== */
.bg-oca-navy {
    background-color: var(--oca-navy);
}

.text-oca-navy {
    color: var(--oca-navy);
}

.border-oca-navy {
    border-color: var(--oca-navy);
}

.bg-oca-sky {
    background-color: var(--oca-sky);
}

.text-oca-sky {
    color: var(--oca-sky);
}

/* Drag & Drop Highlight */
.dropzone {
    border: 2px dashed #CBD5E1;
    transition: all 0.2s ease-in-out;
}

.dropzone.dragover {
    border-color: var(--oca-sky);
    background-color: var(--oca-sky-light);
    transform: scale(1.01);
}

.dropzone.has-file {
    border-color: var(--oca-success);
    background-color: #ECFDF5;
}

/* Stepper Progress Bar */
.step-dot {
    transition: all 0.3s ease;
}

.step-dot.active {
    background-color: var(--oca-sky);
    box-shadow: 0 0 0 4px rgba(0, 163, 224, 0.2);
}

.step-dot.completed {
    background-color: var(--oca-navy);
    color: white;
}

/* Animation for pulsating active state */
@keyframes pulse-ring {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 0.4; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.pulse-active {
    animation: pulse-ring 2s infinite ease-in-out;
}

/* ==========================================================================
   CORPORATE GOOGLE OAUTH 2.0 AUTHENTICATION COMPONENTS
   ========================================================================== */
.auth-gate-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(7, 30, 51, 0.84);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-gate-backdrop.hidden {
    display: none !important;
}

.auth-gate-card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.15);
    max-width: 440px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-gate-header {
    background: linear-gradient(135deg, #0B3356 0%, #071e33 100%);
    padding: 1.75rem 2rem 1.5rem;
    border-bottom: 3px solid #de473c;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.auth-gate-body {
    background-color: #ffffff;
    padding: 2rem 2rem 2.25rem;
}

.auth-domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background-color: #f0f9ff;
    color: #0B3356;
    border: 1px solid #bae6fd;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.auth-google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    background-color: #0B3356;
    border: 1px solid #0B3356;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(11, 51, 86, 0.28);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-google-btn:hover:not(:disabled) {
    background-color: #14436d;
    border-color: #14436d;
    box-shadow: 0 6px 16px rgba(11, 51, 86, 0.38);
    transform: translateY(-1px);
}

.auth-google-btn:active:not(:disabled) {
    transform: translateY(0);
}

.auth-google-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.auth-google-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background-color: #ffffff;
    border-radius: 6px;
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.15rem 0;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
    padding: 0 0.75rem;
}

.auth-guest-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.8rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #0B3356;
    background-color: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.auth-guest-btn:hover:not(:disabled) {
    background-color: #f8fafc;
    border-color: #0B3356;
    color: #0B3356;
    box-shadow: 0 4px 12px rgba(11, 51, 86, 0.12);
    transform: translateY(-1px);
}

.auth-guest-btn:active:not(:disabled) {
    transform: translateY(0);
}

.auth-guest-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
}

.user-session-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    color: #ffffff;
    font-size: 0.75rem;
    line-height: 1.2;
}

.user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    object-fit: cover;
    background: #14436d;
}

.user-logout-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.user-logout-btn:hover {
    color: #ffffff;
    background: rgba(222, 71, 60, 0.85);
}
