/* ERP public-page theme — shared by layouts/auth, layouts/auth2, advancedhrm::partials.career_header
   and repair::layouts.repair_status. Animated gradient backdrop, a cursor light that follows the
   mouse (js/erp-public-theme.js), and the .erp-glass-card content card. Ported from Our ERP
   (its floating icon tiles were dropped on request). */

/* 1. ANIMATED GRADIENT BACKGROUND */
body {
    margin: 0; padding: 0; min-height: 100vh; width: 100%; overflow-x: hidden;
    background: linear-gradient(135deg,
        #e0f2fe 0%, #bae6fd 15%, #ffffff 35%,
        #dbeafe 50%, #1e3a5f 75%, #0f172a 100%);
    background-size: 400% 400%;
    animation: erp-bg-shift 18s ease infinite;
}
@keyframes erp-bg-shift {
    0%   { background-position: 0% 50%; }
    25%  { background-position: 50% 0%; }
    50%  { background-position: 100% 50%; }
    75%  { background-position: 50% 100%; }
    100% { background-position: 0% 50%; }
}
.right-col, .tw-bg-blue-700, .tw-bg-blue-600 { background: transparent !important; }
/* app.css makes .eq-height-row a flex container; without min-width:0 the column can't shrink below its
   min-content width, so non-wrapping header rows widen the whole page on phones. */
.eq-height-row > .right-col { min-width: 0; max-width: 100%; }
.wizard > .content { background-color: #ffffff !important; }
#erp-cursor-light {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    mix-blend-mode: difference;
    background: radial-gradient(circle 350px at 50% 50%, rgba(255,255,255,0.4) 0%, transparent 60%);
}
.container-fluid { position: relative; z-index: 1; }
.erp-glass-card {
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    background-color: rgba(255, 255, 255, 0.55) !important;
    border-radius: 24px !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}
.erp-glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 48px 0 rgba(31, 38, 135, 0.25) !important;
}
@keyframes erp-nav-text {
    0%   { color: #1e3a5f; } 30%  { color: #0f172a; }
    42%  { color: #f0f9ff; } 50%  { color: #f8fafc; }
    75%  { color: #f0f9ff; } 90%  { color: #1e3a5f; } 100% { color: #1e3a5f; }
}
@keyframes erp-nav-border {
    0%   { border-color: rgba(30,58,95,0.75); } 42% { border-color: rgba(240,249,255,0.85); }
    75%  { border-color: rgba(240,249,255,0.85); } 100% { border-color: rgba(30,58,95,0.75); }
}
#change_lang a, #change_lang summary, #business_register_button > a { animation: erp-nav-text 18s ease infinite; }
#business_register_button .tw-border-2 { animation: erp-nav-border 18s ease infinite; }
#business_register_button .tw-border-2 a { animation: erp-nav-text 18s ease infinite; }
/* Every other piece of text that was styled white for the old dark backdrop (page headings, labels,
   links outside the cards — e.g. the pricing header) follows the same cycle: dark on the light phases,
   light on the dark phases. Text inside cards, buttons or gradient chips keeps its own colour.
   (An animation wins over inline style="color:#fff" too, so views need no edits.) */
:is(.tw-text-white, .text-white, h1):not(:is(.erp-glass-card, .bg-white, .tw-bg-white, .tw-bg-gradient-to-r, button, .btn, .tw-dw-btn, .ladda-button, .wizard, .tw-dw-dropdown-content, .dropdown-menu, .modal, .select2-container, #toast-container, .toast, .alert, .label, .badge) *):not(button):not(.btn):not(.tw-dw-btn):not(.ladda-button):not(.tw-bg-gradient-to-r):not(.label):not(.badge) {
    animation: erp-nav-text 18s ease infinite;
}

/* Brand block a page can render in the auth2 header instead of the round logo (@section('brand')).
   White pill so logo and name stay legible through every phase of the animated backdrop. */
.erp-brand {
    display: flex; align-items: center; gap: 12px; width: max-content; max-width: 100%;
    margin: 0 auto 16px; padding: 6px 20px 6px 8px; border-radius: 999px;
    background: #ffffff; border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12); text-decoration: none;
}
.erp-brand:hover, .erp-brand:focus { text-decoration: none; }
.erp-brand img { display: block; height: 46px; width: auto; object-fit: contain; }
.erp-brand span { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; color: #007461; white-space: nowrap; }
@media (max-width: 560px) {
    .erp-brand { gap: 8px; padding: 5px 14px 5px 6px; }
    .erp-brand img { height: 34px; }
    .erp-brand span { font-size: 1.05rem; }
}

/* Mobile burger for the auth2 header. Desktop: the wrapper is display:contents so the two absolutely
   positioned link groups (#change_lang / #business_register_button) lay out exactly as before.
   ≤768px (where app.css already makes those groups static): the groups collapse into a panel
   toggled by #erpNavToggle. */
.erp-public-nav { display: contents; }
.erp-nav-toggle {
    display: none; position: absolute; top: 14px; right: 16px; z-index: 30;
    width: 42px; height: 42px; padding: 0; border-radius: 12px; cursor: pointer;
    background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.erp-nav-toggle span {
    display: block; width: 20px; height: 2px; margin: 0 auto; border-radius: 2px; background: #0f172a;
    transition: transform .2s ease, opacity .2s ease;
}
.erp-nav-toggle span + span { margin-top: 5px; }
.erp-nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.erp-nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.erp-nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* Sign In pill shown next to the burger on phones only */
.erp-nav-signin {
    display: none; position: absolute; top: 14px; right: 68px; z-index: 30;
    height: 42px; padding: 0 16px; border-radius: 12px; align-items: center;
    background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    color: #0f172a !important; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.erp-nav-signin:hover, .erp-nav-signin:focus { color: #0f172a !important; text-decoration: none; background: #ffffff; }
@media (max-width: 768px) {
    .erp-nav-toggle { display: block; }
    .erp-nav-signin { display: inline-flex; }
    .erp-public-nav .erp-signin-link { display: none; }
    .erp-public-nav { display: none; }
    .erp-public-nav.is-open {
        display: block; margin: 0 0 16px; padding: 12px 14px 4px; border-radius: 16px;
        background: rgba(255, 255, 255, 0.92); border: 1px solid rgba(255, 255, 255, 0.6);
        box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    }
    .erp-public-nav.is-open .header-left, .erp-public-nav.is-open .header-right { flex-wrap: wrap; gap: 10px 16px; }
    /* inside the white panel the links are always dark — no background-adaptive cycling */
    .erp-public-nav.is-open a, .erp-public-nav.is-open summary { animation: none !important; color: #0f172a !important; }
    .erp-public-nav.is-open .tw-border-2 { animation: none !important; border-color: #0f172a !important; }
}

/* Premium input focus effect */
input:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2) !important;
    border-color: #6366f1 !important;
}

@media (prefers-reduced-motion: reduce) {
    body,
    #change_lang a, #change_lang summary, #business_register_button > a,
    #business_register_button .tw-border-2, #business_register_button .tw-border-2 a,
    :is(.tw-text-white, .text-white, h1) { animation: none !important; color: #0f172a; }
}
