/* RBI Tailwind-compatible custom styles */

:root {
  --rbi-bg-image: url('/rbi/Assets/Background.png');
  --rbi-bg-blur: 0px;
  --rbi-bg-brightness: 1;
  --rbi-bg-opacity: 1;
}

body {
  min-height: 100vh;
  position: relative;
  z-index: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: -40px;
  background-image: var(--rbi-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(var(--rbi-bg-blur)) brightness(var(--rbi-bg-brightness));
  opacity: var(--rbi-bg-opacity);
  transform: scale(1.05);
  pointer-events: none;
  z-index: -1;
}

.rbi-page {
  padding-top: 0.75rem;
  padding-bottom: 1.5rem;
}

/* Compact defaults for common blocks (lists + tables) */
.rbi-page .divide-y > a.block {
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}

.rbi-page table th,
.rbi-page table td {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Compact common card padding (p-6 -> p-5 scale) */
.rbi-page .p-6,
.rbi-dashboard-wrapper .p-6 {
  padding: 1.25rem;
}

/* Auth pages (login/register) */
.rbi-auth-body {
  background: #ffffff;
}

.rbi-auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.rbi-auth-topbar {
  background: #ffffff;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

.rbi-auth-hero {
  flex: 1 0 auto;
  position: relative;
  overflow: hidden;
}

.rbi-auth-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(64px);
  opacity: 0.25;
  pointer-events: none;
}

.rbi-auth-blob-1 {
  width: 24rem;
  height: 24rem;
  top: -10%;
  right: -5%;
  background: rgba(37, 99, 235, 0.35);
}

.rbi-auth-blob-2 {
  width: 20rem;
  height: 20rem;
  bottom: -5%;
  left: -5%;
  background: rgba(6, 182, 212, 0.25);
  opacity: 0.3;
}

.rbi-auth-card {
  border-radius: 1.5rem;
}

.rbi-auth-panel {
  background: linear-gradient(135deg, rgb(37, 99, 235) 0%, rgb(29, 78, 216) 100%);
  color: rgb(255, 255, 255);
}

.rbi-auth-panel p {
  color: rgba(255, 255, 255, 0.85);
}

.rbi-auth-glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.rbi-auth-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.rbi-auth-field {
  background: #f3f4f6;
  border-radius: 0.5rem;
  padding: 0.25rem;
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.rbi-auth-field:focus-within {
  background: #ffffff;
  box-shadow: 0 2px 0 0 rgb(37, 99, 235);
}

.rbi-auth-field input,
.rbi-auth-field button {
  border: 0;
  background: transparent;
}

.rbi-auth-field input:focus,
.rbi-auth-field button:focus {
  box-shadow: none;
  outline: none;
}

.rbi-auth-note {
  background: #f0f9ff;
  border-radius: 0.5rem;
}

.rbi-auth-footer {
  background: #ffffff;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.rbi-auth-icon-circle {
  width: 40px;
  height: 40px;
}

.rbi-auth-info-icon {
  width: 24px;
  height: 24px;
}

.rbi-auth-progress {
  height: 6px;
}

.rbi-auth-progress-bar {
  width: 98%;
}

.rbi-auth-form {
  max-width: 26rem;
}

/* Pathologist dashboard shell */
.rbi-dashboard-wrapper {
  min-height: 100vh;
}

.rbi-dashboard-topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
}

.rbi-sidenav {
  --tw-translate-x: 0;
}

@media (min-width: 1024px) {
  .rbi-sidenav {
    height: 100vh;
  }
}

.rbi-dashboard-search {
  width: 20rem;
  max-width: 100%;
}

.rbi-kpi-card {
  border-radius: 1.5rem;
}

.rbi-section-card {
  border-radius: 1.5rem;
}

.rbi-progress-885 {
  width: 88.5%;
}

/* Form submission states + loading spinner */
.rbi-auth-submit:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.rbi-form-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: rgba(255, 255, 255, 1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Input autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #111827 !important;
}

input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 2px 0 0 rgb(37, 99, 235), 0 0 0 1000px #ffffff inset !important;
}

/* iPad landscape + keyboard-aware layout */
@media (max-height: 500px) {
  .rbi-auth-hero {
    padding: 1rem 0;
  }
  
  .rbi-auth-blob-1,
  .rbi-auth-blob-2 {
    opacity: 0.1;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .rbi-auth-panel {
    display: none !important;
  }
}

/* Error styling */
.rbi-auth-error {
  background-color: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 0.5rem;
}
