/* ============================================================
   BEICOMP KENYA — MASTER STYLESHEET
   Covers: Landing, Auth Screens, App, Dark Mode, Animations
   ============================================================ */

/* ===== RESETS ===== */
*, *::before, *::after { box-sizing: border-box; }

/* ===== KEYFRAMES ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.94) translateY(14px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes toastSlide {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.55; transform: scale(0.82); }
}
@keyframes rowFadeIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ===== UTILITY ANIMATION CLASSES ===== */
.animate-fade-in        { animation: fadeIn  0.5s ease both; }
.animate-modal-in       { animation: modalIn 0.22s cubic-bezier(0.34,1.56,0.64,1) both; }
.animate-pulse-dot      { animation: pulseDot 2.2s infinite; }
.table-row-animated     { animation: rowFadeIn 0.28s ease both; }

/* ============================================================
   LANDING PAGE — NAV TABS
   ============================================================ */
.nav-tab {
    position: relative;
    padding-bottom: 2px;
    background: none;
    border: none;
    cursor: pointer;
}
.nav-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #16a34a;
    border-radius: 2px;
    transition: width 0.25s ease;
}
.nav-tab:hover::after { width: 100%; }

/* ============================================================
   LANDING — FEATURE & VALUE CARDS
   ============================================================ */
.landing-feature-card,
.landing-value-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.landing-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    border-color: #d1fae5 !important;
}
.landing-value-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.07);
}

/* ============================================================
   ACTIVE CATEGORY TAB (app sub-nav)
   ============================================================ */
.category-tab-active {
    border-bottom: 3px solid #16a34a;
    color: #16a34a !important;
    font-weight: 700;
}

/* ============================================================
   AUTH SCREENS
   ============================================================ */
.auth-screen-wrapper {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    animation: fadeIn 0.28s ease;
}
.auth-screen-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, #14532d 0%, #166534 30%, #15803d 60%, #059669 100%);
    z-index: 0;
}
.auth-screen-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='24' cy='24' r='1.5' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E");
}
.auth-screen-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}
.auth-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0 18px 0;
    transition: color 0.2s, gap 0.2s;
    font-family: inherit;
}
.auth-back-btn:hover { color: #fff; gap: 12px; }

.auth-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 36px 32px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
    animation: modalIn 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
}
.auth-card-header { text-align: center; margin-bottom: 26px; }
.auth-logo-icon {
    width: 66px;
    height: 66px;
    background: linear-gradient(135deg, #16a34a, #059669);
    color: #fff;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 8px 28px rgba(22,163,74,0.4);
}
.auth-card-title    { font-size: 1.5rem; font-weight: 800; color: #111827; margin: 0 0 5px; }
.auth-card-subtitle { font-size: 0.875rem; color: #6b7280; }

.auth-input-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #374151;
    margin-bottom: 7px;
}
.auth-input-wrapper { position: relative; }
.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.875rem;
    pointer-events: none;
}
.auth-input {
    display: block;
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid #e5e7eb;
    border-radius: 11px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    background: #f9fafb;
    color: #1f2937;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.auth-input:focus {
    border-color: #16a34a;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.14);
}
.auth-input.has-eye { padding-right: 46px; }

.auth-eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 0.9rem;
    padding: 6px;
    transition: color 0.18s;
    z-index: 2;
    line-height: 1;
}
.auth-eye-btn:hover { color: #374151; }

.auth-submit-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #16a34a 0%, #059669 100%);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    border: none;
    border-radius: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 18px rgba(22,163,74,0.34);
    font-family: inherit;
    margin-top: 4px;
}
.auth-submit-btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(22,163,74,0.44); }
.auth-submit-btn:active { transform: translateY(0); }

.auth-switch-text {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 20px;
}
.auth-switch-link {
    color: #16a34a;
    font-weight: 700;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.18s;
}
.auth-switch-link:hover { color: #15803d; }

.auth-error {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 16px;
    animation: slideUp 0.2s ease;
}

.password-strength-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 7px;
}
.password-strength-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.35s ease, background-color 0.35s ease;
}

.reset-panel {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    animation: slideUp 0.2s ease;
}
.reset-success-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 9px 13px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 10px;
    animation: fadeIn 0.25s ease;
}

#paste-drop-zone:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.18);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    animation: toastSlide 0.3s ease;
}
.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    border-radius: 14px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 14px 44px rgba(0,0,0,0.2);
    font-family: inherit;
    min-width: 240px;
    color: #fff;
    background: #1f2937;
}
.toast-content.success { background: #14532d; }
.toast-content.error   { background: #7f1d1d; }
.toast-content.info    { background: #1e3a8a; }

/* ============================================================
   DARK MODE
   ============================================================ */
.dark-mode {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}
.dark-mode .bg-white,
.dark-mode .header-container,
.dark-mode .content-card,
.dark-mode .modal-card {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}
.dark-mode .bg-gray-50,
.dark-mode .subnav-container,
.dark-mode .table-header-row,
.dark-mode .routing-selector-box,
.dark-mode #paste-drop-zone {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}
.dark-mode .text-gray-600,
.dark-mode .card-subheading,
.dark-mode .setting-desc,
.dark-mode .modal-subtitle,
.dark-mode .branch-distance { color: #94a3b8 !important; }
.dark-mode .text-gray-900,
.dark-mode .brand-text,
.dark-mode .card-heading,
.dark-mode .modal-title,
.dark-mode .branch-title,
.dark-mode .setting-name    { color: #f8fafc !important; }
.dark-mode .border-gray-200,
.dark-mode .border-gray-100,
.dark-mode th, .dark-mode td { border-color: #334155 !important; }
.dark-mode .search-field,
.dark-mode .text-field,
.dark-mode .select-field {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}
.dark-mode .search-field::placeholder { color: #64748b !important; }
.dark-mode .theme-toggle-button {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}
.dark-mode .theme-toggle-button:hover { background-color: #475569 !important; }
.dark-mode .table-body-rows tr:hover  { background-color: #1a2d3f !important; }
.dark-mode #paste-prompt-text { color: #94a3b8 !important; }
.dark-mode #paste-prompt-text kbd {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}
.dark-mode footer.app-footer {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .auth-card { padding: 28px 20px; }
    .toast-notification { bottom: 16px; right: 16px; left: 16px; }
    .toast-content { min-width: unset; }
}