/* Euroclean Authelia — soft & minimal */

:root {
  --ec-bg: #f3f3f3;
  --ec-card: #ffffff;
  --ec-border: #e5e7eb;
  --ec-text: #1f2937;
  --ec-muted: #6b7280;
  --ec-blue: #2563eb;
  --ec-blue-hover: #1d4ed8;
  --ec-legal-bg: #fffbeb;
  --ec-legal-border: #f0ad4e;
  --ec-legal-text: #5c4a1a;
  --ec-width: 400px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  background: var(--ec-bg) !important;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
}

body::before {
  display: none !important;
}

body {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh !important;
  padding: 20px 16px !important;
}

/* Tek kart: logo + form */
#ec-portal-wrap {
  width: 100%;
  max-width: var(--ec-width);
  background: var(--ec-card);
  border: 1px solid var(--ec-border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 28px 24px 20px;
}

#root {
  width: 100% !important;
  min-height: unset !important;
  height: auto !important;
}

#root > div,
#root .MuiGrid-root,
#root .MuiGrid-container,
#root .MuiGrid-item,
#root .MuiBox-root {
  min-height: unset !important;
  height: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

/* Boş üst kutusu gizle */
#root .MuiPaper-root:not(:has(.MuiOutlinedInput-root, img[alt="Logo"])) {
  display: none !important;
}

.MuiPaper-root {
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.MuiPaper-root .MuiCardContent-root,
.MuiPaper-root > .MuiBox-root {
  padding: 0 !important;
}

/* Login altı varsayılan Powered by — gizle */
#root .MuiButton-containedPrimary ~ *,
#root .MuiTypography-caption,
#root a[href*="authelia.com"] {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.MuiTypography-caption {
  display: none !important;
}

/* Authelia — Euroclean logosunun üstünde */
.ec-authelia-top {
  text-align: center;
  margin-bottom: 18px;
}

.ec-authelia-top a {
  display: inline-block;
  text-decoration: none;
  line-height: 0;
}

.ec-authelia-top img {
  display: block !important;
  max-width: 200px !important;
  max-height: 40px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 auto !important;
  border-radius: 2px;
}

.ec-authelia-top p {
  margin: 6px 0 0 0;
  color: var(--ec-muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

img[alt="Logo"] {
  display: block !important;
  max-width: 200px !important;
  max-height: 40px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  filter: none !important;
  margin: 0 auto 20px !important;
}

/* Yasal uyarı — kartın alt bandı */
.MuiTypography-h6 {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.MuiTypography-body2,
.MuiFormLabel-root,
label {
  color: var(--ec-muted) !important;
  font-size: 0.875rem !important;
}

.MuiOutlinedInput-root {
  border-radius: 6px !important;
  background: #fafafa !important;
}

.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: #cbd5e1 !important;
}

.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: var(--ec-blue) !important;
  border-width: 1px !important;
}

.MuiOutlinedInput-input {
  color: var(--ec-text) !important;
  padding: 12px 14px !important;
  font-size: 0.9375rem !important;
}

.MuiButton-containedPrimary {
  background: var(--ec-blue) !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  font-weight: 500 !important;
  font-size: 0.9375rem !important;
  padding: 10px 16px !important;
  text-transform: none !important;
  margin-top: 6px !important;
}

.MuiButton-containedPrimary:hover {
  background: var(--ec-blue-hover) !important;
}

a[href*="reset"],
button[class*="reset"] {
  display: none !important;
}

.MuiTypography-h5,
.ec-legal-notice {
  width: calc(100% + 48px);
  margin: 16px -24px -20px;
  padding: 12px 14px;
  border: none;
  border-top: 1px solid var(--ec-legal-border);
  border-radius: 0 0 8px 8px;
  background: var(--ec-legal-bg);
  color: var(--ec-legal-text);
  font-size: 11.5px;
  line-height: 1.55;
}

.ec-legal-notice p {
  margin: 0 0 7px 0;
}

.ec-legal-notice p:last-child {
  margin-bottom: 0;
}

.ec-legal-title {
  font-weight: 600;
  font-size: 12.5px;
  color: #8a6d3b;
  margin-bottom: 8px !important;
}

.ec-legal-contact a {
  color: var(--ec-blue);
  text-decoration: none;
  font-weight: 500;
}

.ec-legal-contact a:hover {
  text-decoration: underline;
}

body[data-theme="dark"] {
  background: #1a1a2e !important;
}

body[data-theme="dark"] #ec-portal-wrap {
  background: #252536;
  border-color: #3a3a4a;
}

body[data-theme="dark"] img[alt="Logo"] {
  filter: brightness(0) invert(1) !important;
}

body[data-theme="dark"] .MuiOutlinedInput-root {
  background: #1e1e2e !important;
}

body[data-theme="dark"] .MuiOutlinedInput-input,
body[data-theme="dark"] .MuiFormLabel-root {
  color: #e5e7eb !important;
}

body[data-theme="dark"] .ec-authelia-top p {
  color: #9ca3af;
}

body[data-theme="dark"] .ec-legal-notice {
  background: #3d3420;
  border-color: #8a6d3b;
  color: #f5e6c8;
}

body[data-theme="dark"] .ec-legal-title {
  color: #ffd966;
}

body[data-theme="dark"] .ec-legal-contact a {
  color: #93c5fd;
}

@media (max-width: 480px) {
  body {
    padding: 12px !important;
  }

  #ec-portal-wrap {
    padding: 22px 18px 16px;
  }

  .ec-legal-notice {
    width: calc(100% + 36px);
    margin: 14px -18px -16px;
  }
}
