/* Simp - Estilos globais */
html, body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

h1:focus {
    outline: none;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Ocorreu um erro inesperado."
}

/* === Login Page === */
.login-container {
   display: flex;
   min-height: 100vh;
   width: 100%;
}

.login-form-panel {
   flex: 1.5;
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 48px 32px;
   background: var(--mud-palette-surface);
}

.login-form-wrapper {
   width: 100%;
   max-width: 400px;
   display: flex;
   flex-direction: column;
   min-height: 520px;
}

.login-language-bar {
   display: flex;
   justify-content: flex-end;
   margin-bottom: 16px;
}

.login-brand-mark {
   text-align: center;
   margin-bottom: 32px;
}

.login-brand-mark img {
   max-width: 300px;
   height: auto;
}

.login-footer {
   text-align: center;
   margin-top: auto;
   padding-top: 32px;
}

.login-brand-panel {
   flex: 1;
   display: flex;
   align-items: center;
   justify-content: center;
   background: linear-gradient(160deg, #0c1821 0%, #132e3d 45%, #1a3028 75%, #0f1923 100%);
   position: relative;
   overflow: hidden;
}

.login-brand-panel::before {
   content: '';
   position: absolute;
   inset: 0;
   background:
      radial-gradient(ellipse at 30% 40%, rgba(95, 187, 83, 0.08) 0%, transparent 60%),
      radial-gradient(ellipse at 70% 60%, rgba(34, 167, 208, 0.06) 0%, transparent 50%);
   pointer-events: none;
}

.login-brand-image {
   position: relative;
   z-index: 1;
   max-width: 85%;
   max-height: 70%;
   object-fit: contain;
   filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.3));
}

@media (max-width: 960px) {
   .login-brand-panel {
      display: none;
   }

   .login-form-panel {
      flex: 1;
   }
}

/* === Dashboard Animations === */

/* Keyframes */
@keyframes dash-fade-up {
   from { opacity: 0; transform: translateY(20px); }
   to   { opacity: 1; transform: translateY(0); }
}

@keyframes dash-bar-grow {
   from { height: 0; }
}

@keyframes dash-progress-fill {
   from { width: 0; }
}

@keyframes dash-fade-in {
   from { opacity: 0; }
   to   { opacity: 1; }
}

@keyframes dash-number-pop {
   0%   { transform: scale(0.6); opacity: 0; }
   70%  { transform: scale(1.08); }
   100% { transform: scale(1); opacity: 1; }
}

/* === KPI Cards — staggered slide-up + hover lift === */
.dash-kpi {
   animation: dash-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
   animation-delay: var(--delay, 0ms);
   transition: transform 0.2s ease, box-shadow 0.2s ease;
   cursor: default;
}

.dash-kpi:hover {
   transform: translateY(-3px);
   box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1) !important;
}

.dash-kpi .dash-kpi-value {
   animation: dash-number-pop 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
   animation-delay: calc(var(--delay, 0ms) + 200ms);
}

.dash-kpi .dash-kpi-icon {
   transition: transform 0.3s ease;
}

.dash-kpi:hover .dash-kpi-icon {
   transform: scale(1.15);
}

/* === Section Cards — fade-in === */
.dash-section {
   animation: dash-fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
   animation-delay: var(--delay, 300ms);
}

/* === Evolution Bar Chart === */
.dashboard-bars {
   display: flex;
   align-items: flex-end;
   gap: 2px;
   padding-bottom: 24px;
   position: relative;
}

.dashboard-bar-col {
   flex: 1;
   display: flex;
   flex-direction: column;
   align-items: center;
   min-width: 0;
   height: 100%;
   justify-content: flex-end;
}

.dashboard-bar {
   width: 100%;
   max-width: 32px;
   background: linear-gradient(to top, #3d8b41, #5fb853);
   border-radius: 3px 3px 0 0;
   min-height: 2px;
   animation: dash-bar-grow 0.8s cubic-bezier(0.22, 1, 0.36, 1) backwards;
   animation-delay: var(--bar-delay, 0ms);
   transition: background 0.2s ease, filter 0.2s ease;
}

.dashboard-bar-col:hover .dashboard-bar {
   filter: brightness(1.15);
   background: linear-gradient(to top, #4A9B4E, #6fcf73);
}

.dashboard-bar-col:hover .dashboard-bar-value {
   opacity: 1;
   color: var(--mud-palette-text-primary);
   font-weight: 600;
}

.dashboard-bar-label {
   font-size: 10px;
   color: var(--mud-palette-text-secondary);
   margin-top: 4px;
   text-align: center;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
   max-width: 100%;
   animation: dash-fade-in 0.4s ease backwards;
   animation-delay: calc(var(--bar-delay, 0ms) + 400ms);
}

.dashboard-bar-value {
   font-size: 10px;
   color: var(--mud-palette-text-secondary);
   margin-bottom: 2px;
   transition: color 0.2s ease, opacity 0.2s ease;
   animation: dash-fade-in 0.4s ease backwards;
   animation-delay: calc(var(--bar-delay, 0ms) + 500ms);
}

/* === Distribution / Category Progress Bars — animate fill === */
.dash-progress-row {
   animation: dash-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
   animation-delay: var(--delay, 0ms);
}

.dash-progress-row .mud-progress-linear-bar {
   animation: dash-progress-fill 0.8s cubic-bezier(0.22, 1, 0.36, 1) backwards;
   animation-delay: calc(var(--delay, 0ms) + 200ms);
}

/* === Activity Table Rows — staggered fade === */
.dash-activity-row {
   animation: dash-fade-in 0.5s ease backwards;
   animation-delay: var(--delay, 0ms);
}

.dash-activity-row:hover {
   background: var(--mud-palette-action-default-hover);
}

/* === Reduce motion for accessibility === */
@media (prefers-reduced-motion: reduce) {
   .dash-kpi,
   .dash-section,
   .dashboard-bar,
   .dashboard-bar-label,
   .dashboard-bar-value,
   .dash-progress-row,
   .dash-progress-row .mud-progress-linear-bar,
   .dash-activity-row,
   .dash-kpi .dash-kpi-value {
      animation: none !important;
   }
}
