/**
 * Medsea split auth — login / forgot password / reset
 * Left: brand + illustration | Right: form panel
 * Light theme — aligned with html.light-layout / admin-filament-theme.css
 */

:root {
  --medsea-auth-canvas: #eef2f7;
  --medsea-auth-brand-bg: #e2e8f0;
  --medsea-auth-brand-bg-end: #f1f5f9;
  --medsea-auth-panel: #ffffff;
  --medsea-auth-panel-border: #e2e8f0;
  --medsea-auth-text: #334155;
  --medsea-auth-muted: #64748b;
  --medsea-auth-accent: #3b82f6;
  --medsea-auth-accent-hover: #2563eb;
  --medsea-auth-link: #2563eb;
  --medsea-auth-input-bg: #ffffff;
  --medsea-auth-radius: 0.75rem;
}

body.blank-page {
  background: var(--medsea-auth-canvas) !important;
  min-height: 100vh;
}

body.blank-page .content.app-content,
body.blank-page .content-wrapper,
body.blank-page .content-body {
  padding: 0 !important;
  margin: 0 !important;
  min-height: 100vh;
}

.medsea-auth {
  display: flex;
  min-height: 100vh;
  width: 100%;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.medsea-auth__brand {
  flex: 1 1 58%;
  max-width: 58%;
  background: linear-gradient(165deg, var(--medsea-auth-brand-bg) 0%, var(--medsea-auth-brand-bg-end) 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.medsea-auth__brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 20% 80%, rgba(59, 130, 246, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 20%, rgba(147, 197, 253, 0.2), transparent 50%);
  pointer-events: none;
}

.medsea-auth__logo {
  position: relative;
  z-index: 2;
  padding: 2rem 2.5rem 1rem;
}

.medsea-auth__logo img {
  height: 52px;
  width: auto;
  display: block;
}

.medsea-auth__illustration {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2.5rem 3rem;
  position: relative;
  z-index: 2;
}

.medsea-auth__illustration img {
  max-width: 100%;
  height: auto;
  max-height: min(72vh, 520px);
  object-fit: contain;
  filter: drop-shadow(0 16px 32px rgb(15 23 42 / 0.08));
}

.medsea-auth__panel {
  flex: 1 1 42%;
  max-width: 42%;
  background: var(--medsea-auth-panel);
  border-left: 1px solid var(--medsea-auth-panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  box-shadow: -4px 0 24px rgb(15 23 42 / 0.06);
}

.medsea-auth__inner {
  width: 100%;
  max-width: 400px;
}

.medsea-auth__title {
  color: var(--medsea-auth-text);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

.medsea-auth__lead {
  color: var(--medsea-auth-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.medsea-auth .form-group {
  margin-bottom: 1.15rem;
}

.medsea-auth label,
.medsea-auth .form-label {
  color: var(--medsea-auth-text);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.medsea-auth .form-control,
.medsea-auth .form-control-merge {
  background: var(--medsea-auth-input-bg) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--medsea-auth-radius) !important;
  color: #0f172a !important;
  font-size: 0.9375rem;
  padding: 0.65rem 1rem !important;
  min-height: 48px;
}

.medsea-auth .form-control::placeholder {
  color: #94a3b8;
}

.medsea-auth .form-control:focus {
  border-color: var(--medsea-auth-accent) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18) !important;
}

.medsea-auth .form-control.is-invalid {
  border-color: #ef4444 !important;
}

.medsea-auth .input-group-merge .form-control {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.medsea-auth .input-group-append .input-group-text {
  background: var(--medsea-auth-input-bg) !important;
  border: 1px solid #e2e8f0 !important;
  border-left: 0 !important;
  border-radius: 0 var(--medsea-auth-radius) var(--medsea-auth-radius) 0 !important;
  color: #64748b !important;
  cursor: pointer;
  min-height: 48px;
}

.medsea-auth .d-flex.justify-content-between label {
  margin-bottom: 0;
}

.medsea-auth a.small,
.medsea-auth .medsea-auth__link {
  color: var(--medsea-auth-link) !important;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}

.medsea-auth a.small:hover,
.medsea-auth .medsea-auth__link:hover {
  color: var(--medsea-auth-accent-hover) !important;
  text-decoration: underline;
}

.medsea-auth .custom-control-label {
  color: var(--medsea-auth-muted) !important;
  font-size: 0.875rem;
}

.medsea-auth .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--medsea-auth-accent);
  border-color: var(--medsea-auth-accent);
}

.medsea-auth .custom-checkbox .custom-control-label::before {
  border-radius: 4px;
  background-color: #fff;
  border-color: #cbd5e1;
}

.medsea-auth__btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--medsea-auth-radius);
  background: linear-gradient(135deg, #93c5fd 0%, var(--medsea-auth-accent) 100%) !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.75rem 1.25rem;
  min-height: 48px;
  margin-top: 0.25rem;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  text-align: center;
  text-decoration: none !important;
  line-height: 1.4;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.medsea-auth__btn:hover {
  background: linear-gradient(135deg, #60a5fa 0%, var(--medsea-auth-accent-hover) 100%) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.32);
}

.medsea-auth__btn + .medsea-auth__btn {
  margin-top: 0.75rem;
}

.medsea-auth__captcha {
  margin: 1rem 0;
  transform-origin: top left;
}

.medsea-auth .alert {
  border-radius: var(--medsea-auth-radius);
  font-size: 0.875rem;
}

.medsea-auth .alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.medsea-auth .help-block.alert {
  border-radius: var(--medsea-auth-radius);
}

.medsea-auth .invalid-feedback,
.medsea-auth .text-danger {
  color: #dc2626 !important;
  font-size: 0.8125rem;
}

.medsea-auth .text-center.mt-2 {
  margin-top: 1.25rem !important;
}

.medsea-auth .text-center.mt-2 a {
  color: var(--medsea-auth-link) !important;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

@media (max-width: 991.98px) {
  .medsea-auth {
    flex-direction: column;
  }

  .medsea-auth__brand,
  .medsea-auth__panel {
    max-width: 100%;
    flex-basis: auto;
  }

  .medsea-auth__brand {
    min-height: auto;
    padding-bottom: 0;
  }

  .medsea-auth__logo {
    padding: 1.25rem 1.5rem 0.5rem;
  }

  .medsea-auth__illustration {
    padding: 0.5rem 1.5rem 1.5rem;
  }

  .medsea-auth__illustration img {
    max-height: 200px;
  }

  .medsea-auth__panel {
    border-left: none;
    border-top: 1px solid var(--medsea-auth-panel-border);
    flex: 1;
    padding: 2rem 1.25rem 2.5rem;
    box-shadow: none;
  }

  .medsea-auth__captcha {
    transform: scale(0.92);
  }
}
