/* ====================================================================
   CEO-VW ENTERPRISE UI (Conflict-Free, Responsive, Accessible)
==================================================================== */

#ceovw-corporate-app {
    all: initial; /* Strips theme inheritance */
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    box-sizing: border-box;
    width: 100%;
    color: #1f2937;
}

#ceovw-corporate-app * {
    box-sizing: border-box;
}

#ceovw-corporate-app .ceovw-app-card {
    width: 100%;
    max-width: 28rem;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    padding: 2.5rem;
    position: relative;
    border: 1px solid #f3f4f6;
    overflow: hidden;
}

#ceovw-corporate-app .ceovw-app-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 0.35rem;
    background: linear-gradient(90deg, var(--ceovw-brand, #2563eb), #6366f1);
}

/* Typography */
#ceovw-corporate-app .ceovw-header { 
    text-align: center; 
    margin-bottom: 2rem; 
}
#ceovw-corporate-app .ceovw-header h2 { font-size: 1.75rem; font-weight: 700; color: #111827; margin: 0 0 0.5rem; line-height: 1.2; }
#ceovw-corporate-app .ceovw-header p { font-size: 0.875rem; color: #6b7280; margin: 0; }

/* Fields */
#ceovw-corporate-app .ceovw-field-row { display: flex; gap: 1rem; }
#ceovw-corporate-app .ceovw-field-row .ceovw-field-group { flex: 1; }
#ceovw-corporate-app .ceovw-field-group { margin-bottom: 1.25rem; text-align: left; }
#ceovw-corporate-app label { display: block; font-size: 0.875rem; font-weight: 600; color: #374151; margin-bottom: 0.5rem; }
#ceovw-corporate-app input[type="text"],
#ceovw-corporate-app input[type="email"],
#ceovw-corporate-app input[type="password"] {
    width: 100%; padding: 0.75rem 1rem; font-size: 0.95rem; font-family: inherit;
    border: 1px solid #d1d5db; border-radius: 0.5rem; background: #f9fafb;
    transition: all 0.2s ease; outline: none; color: #111827;
}
#ceovw-corporate-app input:focus { border-color: var(--ceovw-brand); background: #ffffff; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }

/* Links & Actions */
#ceovw-corporate-app .ceovw-actions-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; font-size: 0.875rem; }
#ceovw-corporate-app .ceovw-link { color: var(--ceovw-brand); font-weight: 600; text-decoration: none; cursor: pointer; transition: color 0.2s; }
#ceovw-corporate-app .ceovw-link:hover { color: #1d4ed8; text-decoration: underline; }
#ceovw-corporate-app .ceovw-checkbox { display: flex; align-items: center; cursor: pointer; font-size: 0.875rem; color: #4b5563; }
#ceovw-corporate-app .ceovw-checkbox input { margin-right: 0.5rem; cursor: pointer; }

/* Buttons & Loaders */
#ceovw-corporate-app .ceovw-btn {
    width: 100%; padding: 0.875rem; font-size: 1rem; font-weight: 600; font-family: inherit;
    border: none; border-radius: 0.5rem; cursor: pointer; transition: all 0.2s;
    display: flex; justify-content: center; align-items: center; position: relative;
}
#ceovw-corporate-app .ceovw-btn-primary { background: var(--ceovw-brand); color: #ffffff; box-shadow: 0 4px 6px -1px rgba(37,99,235,0.2); }
#ceovw-corporate-app .ceovw-btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
#ceovw-corporate-app .ceovw-btn.loading .btn-text { visibility: hidden; }
#ceovw-corporate-app .btn-loader {
    display: none; position: absolute; width: 1.25rem; height: 1.25rem;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #ffffff;
    border-radius: 50%; animation: ceovw-spin 0.8s linear infinite;
}
#ceovw-corporate-app .ceovw-btn.loading .btn-loader { display: block; }
@keyframes ceovw-spin { to { transform: rotate(360deg); } }

/* Footer Nav */
#ceovw-corporate-app .ceovw-footer-nav { text-align: center; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #e5e7eb; font-size: 0.875rem; color: #6b7280; }

/* Inline form messages (replace browser alerts) */
#ceovw-corporate-app .ceovw-form-msg { margin: 0 0 1rem; padding: 0.7rem 0.9rem; border-radius: 0.6rem; font-size: 0.875rem; line-height: 1.45; text-align: left; }
#ceovw-corporate-app .ceovw-form-msg[hidden] { display: none; }
#ceovw-corporate-app .ceovw-form-msg.is-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
#ceovw-corporate-app .ceovw-form-msg.is-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
#ceovw-corporate-app input:focus-visible, #ceovw-corporate-app button:focus-visible, #ceovw-corporate-app a:focus-visible { outline: 2px solid var(--ceovw-brand, #2563eb); outline-offset: 2px; }
#ceovw-corporate-app .ceovw-btn:disabled { cursor: default; opacity: .85; }

/* OTP Modal: same visual language as the checkout popup */
#ceovw-corporate-app .ceovw-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; padding: 16px; background: rgba(15, 23, 42, 0.55); display: flex; justify-content: center; align-items: center; z-index: 99999; box-sizing: border-box; }
#ceovw-corporate-app .ceovw-modal-content { background: #fff; padding: 2rem 1.75rem 1.25rem; border-radius: 18px; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow-y: auto; position: relative; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28); text-align: center; animation: ceovw-slide-up 0.2s ease-out; }
@keyframes ceovw-slide-up { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
#ceovw-corporate-app .ceovw-modal-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; padding: 0; border: none; border-radius: 10px; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: #6b7280; }
#ceovw-corporate-app .ceovw-modal-close:hover { background: #f3f4f6; color: #111827; }
#ceovw-corporate-app .ceovw-modal-icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; color: var(--ceovw-brand, #2563eb); background: #eef2ff; background: color-mix(in srgb, var(--ceovw-brand, #2563eb) 12%, #fff); }
#ceovw-corporate-app .ceovw-modal-header h3 { margin: 0 0 8px; font-size: 21px; font-weight: 700; line-height: 1.3; color: #111827; }
#ceovw-corporate-app .ceovw-modal-header p { margin: 0; font-size: 14.5px; line-height: 1.55; color: #4b5563; overflow-wrap: anywhere; }
#ceovw-corporate-app .ceovw-otp-inputs { display: flex; justify-content: center; gap: 8px; margin: 1.25rem 0 0.25rem; }
#ceovw-corporate-app .ceovw-otp-box { width: 46px !important; height: 56px !important; margin: 0 !important; padding: 0 !important; text-align: center; font-size: 24px !important; font-weight: 700; color: #111827; background: #f9fafb !important; border: 1.5px solid #d1d5db !important; border-radius: 12px !important; box-shadow: none; }
#ceovw-corporate-app .ceovw-otp-box:focus { border-color: var(--ceovw-brand, #2563eb) !important; background: #fff !important; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ceovw-brand, #2563eb) 15%, transparent); outline: none; }
#ceovw-corporate-app .ceovw-error-msg { min-height: 1.4rem; margin: 10px 0; color: #b91c1c; font-size: 13.5px; line-height: 1.4; }
#ceovw-corporate-app .ceovw-error-msg.is-success { color: #047857; font-weight: 600; }
#ceovw-corporate-app #ceovw-btn-verify { height: 48px; border-radius: 12px; }
#ceovw-corporate-app .ceovw-resend-wrapper { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 1rem; font-size: 0.875rem; color: #6b7280; }
#ceovw-corporate-app #ceovw-btn-resend { padding: 4px 2px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ceovw-brand, #2563eb); cursor: pointer; }
#ceovw-corporate-app #ceovw-btn-resend:disabled { color: #9ca3af; cursor: not-allowed; text-decoration: none; font-weight: 500; }
#ceovw-corporate-app .ceovw-modal-tip { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid #f1f5f9; font-size: 12.5px; line-height: 1.5; color: #6b7280; }

/* Responsive */
@media (max-width: 480px) {
    #ceovw-corporate-app .ceovw-app-card { padding: 2rem 1.5rem; }
    #ceovw-corporate-app .ceovw-field-row { flex-direction: column; gap: 0; }
    #ceovw-corporate-app .ceovw-modal-overlay { align-items: flex-end; padding: 0; }
    #ceovw-corporate-app .ceovw-modal-content { max-width: none; border-radius: 18px 18px 0 0; padding: 1.75rem 1.1rem 1.1rem; }
    #ceovw-corporate-app .ceovw-otp-inputs { gap: 6px; }
    #ceovw-corporate-app .ceovw-otp-box { width: calc((100% - 30px) / 6) !important; max-width: 48px; height: 52px !important; font-size: 22px !important; }
}
@media (prefers-reduced-motion: reduce) {
    #ceovw-corporate-app .ceovw-modal-content, #ceovw-corporate-app .btn-loader { animation: none; }
}
