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

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
}

.engine-wrapper,
.hero-shell,
.fiqh-insight {
  overflow-x: hidden;
}

:root {
  --auth-bg: #06142d;
  --auth-surface: rgba(7, 24, 49, 0.72);
  --auth-surface-strong: rgba(12, 33, 66, 0.9);
  --auth-border: rgba(255, 255, 255, 0.12);
  --auth-text: #eff6ff;
  --auth-muted: #bfd3f2;
  --auth-gold: #f4c95d;
  --auth-emerald: #2dd4bf;
  --auth-emerald-dark: #0f766e;
  --auth-shadow: 0 28px 60px rgba(2, 10, 24, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--auth-text);
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(244, 201, 93, 0.16), transparent 28%),
    linear-gradient(145deg, #041226 0%, #08203e 44%, #0d2f5b 100%);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../assets/images/islamic-pattern.png") center/cover no-repeat;
  opacity: 0.07;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.16), transparent 18%);
  pointer-events: none;
}

.auth-page {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.auth-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--auth-text);
  text-decoration: none;
}

.brand-badge {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.2), rgba(59, 130, 246, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 14px 30px rgba(2, 10, 24, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.brand-badge img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.35));
}

.brand-link strong {
  display: block;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, #eaf2ff 0%, #7dd3fc 55%, #2dd4bf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-link small {
  font-size: 0.82rem;
}

.brand-link small,
.auth-topbar nav a,
.info-list,
.auth-subtext,
.helper-card p,
.form-note,
.field-label,
.feature-list,
.default-card p,
.auth-message,
.helper-links a,
.auth-side p {
  color: var(--auth-muted);
}

.auth-topbar nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.auth-topbar nav a {
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.auth-topbar nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #eaf2ff;
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 26px;
  align-items: stretch;
}

.auth-side,
.auth-card {
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  box-shadow: var(--auth-shadow);
  backdrop-filter: blur(16px);
  border-radius: 30px;
}

.auth-side {
  padding: 36px;
  position: relative;
  overflow: hidden;
}

.auth-side::after {
  content: "";
  position: absolute;
  inset: auto -120px -140px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.28), transparent 65%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--auth-gold);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-side h1 {
  margin: 18px 0 16px;
  font-size: clamp(2rem, 4.2vw, 3.75rem);
  line-height: 1.1;
  font-family: "Sora", "Plus Jakarta Sans", "Amiri", sans-serif;
}

.auth-side h1 span {
  background: linear-gradient(135deg, var(--auth-gold), #fde68a 45%, #2dd4bf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-side p {
  margin: 0;
  max-width: 48ch;
  line-height: 1.8;
}

.info-list,
.feature-list {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.info-list li,
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.7;
}

.info-list li::before,
.feature-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--auth-gold), var(--auth-emerald));
  box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.12);
}

.auth-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.helper-card,
.default-card {
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.helper-card strong,
.default-card strong {
  display: block;
  margin-bottom: 8px;
}

.auth-card {
  padding: 34px;
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.auth-subtext {
  margin: 0 0 28px;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field-row {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 0.95rem;
  font-weight: 600;
}

.input-field {
  width: 100%;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: var(--auth-text);
  font: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.input-field::placeholder {
  color: rgba(239, 246, 255, 0.46);
}

.input-field:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.72);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.form-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-note {
  margin: -4px 0 6px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.auth-message {
  min-height: 24px;
  font-size: 0.92rem;
}

.auth-message.error {
  color: #fecaca;
}

.auth-message.success {
  color: #bbf7d0;
}

.submit-btn,
.alt-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 15px 18px;
  border-radius: 18px;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.submit-btn {
  color: #072032;
  background: linear-gradient(135deg, var(--auth-gold), #ffe9a8);
  box-shadow: 0 18px 30px rgba(244, 201, 93, 0.22);
}

.alt-btn {
  color: var(--auth-text);
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.25), rgba(59, 130, 246, 0.24));
  border: 1px solid rgba(45, 212, 191, 0.28);
}

.submit-btn:hover,
.alt-btn:hover {
  transform: translateY(-2px);
}

.auth-divider-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.auth-divider {
  color: var(--auth-muted);
  font-size: 0.9rem;
}

#googleSigninBtn {
  display: flex;
  justify-content: center;
}

#googleSigninBtn iframe {
  border-radius: 8px;
}

.helper-links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.helper-links a {
  text-decoration: none;
}

.auth-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-footer p {
  margin: 0;
  color: var(--auth-muted);
  line-height: 1.6;
}

.inline-link {
  color: var(--auth-gold);
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-side,
  .auth-card {
    padding: 28px;
  }
}

@media (max-width: 640px) {
  .auth-page {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .auth-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-topbar nav {
    gap: 12px;
  }

  .form-split,
  .auth-meta {
    grid-template-columns: 1fr;
  }

  .auth-card,
  .auth-side {
    border-radius: 24px;
    padding: 22px;
  }

  .auth-side h1 {
    font-size: 2rem;
  }
}

.auth-topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-lang-dropdown {
  position: relative;
}

.auth-lang-dropdown .lang-btn {
  min-width: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--auth-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-lang-dropdown .lang-btn .lang-btn-icon {
  font-size: 13px;
  line-height: 1;
}

.auth-lang-dropdown .lang-btn .lang-btn-code {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.14);
  line-height: 1;
}

.auth-lang-dropdown .lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 156px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(6, 20, 45, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px rgba(2, 10, 24, 0.35);
  display: none;
  z-index: 20;
}

.auth-lang-dropdown .lang-menu button {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--auth-text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.auth-lang-dropdown .lang-menu button:hover,
.auth-lang-dropdown .lang-menu button.active {
  background: rgba(255, 255, 255, 0.1);
}

.auth-lang-dropdown.active .lang-menu {
  display: block;
}

body.rtl-ui .auth-page,
body.rtl-ui .auth-side,
body.rtl-ui .auth-card,
body.rtl-ui .auth-footer,
body.rtl-ui .auth-topbar nav,
body.rtl-ui .brand-link {
  text-align: right;
}

/* Desktop RTL: horizontal, content mulai dari kanan */
@media (min-width: 641px) {
  body.rtl-ui .auth-topbar {
    flex-direction: row;
    justify-content: flex-start;
    direction: rtl;
  }

  body.rtl-ui .auth-topbar-actions {
    flex-direction: row-reverse;
    justify-content: flex-start;
    align-items: center;
    direction: ltr;
  }

  body.rtl-ui .auth-topbar-actions nav {
    flex-direction: row-reverse;
  }
}

/* Mobile RTL: stacked (brand top, menu below) */
@media (max-width: 640px) {
  body.rtl-ui .auth-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  body.rtl-ui .auth-topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.rtl-ui .auth-topbar-actions nav {
    justify-content: center;
  }
}

body.rtl-ui .brand-link,
body.rtl-ui .auth-topbar nav,
body.rtl-ui .auth-footer {
  flex-direction: row-reverse;
}

body.rtl-ui .info-list,
body.rtl-ui .feature-list {
  direction: rtl;
  justify-items: stretch;
}

body.rtl-ui .info-list li,
body.rtl-ui .feature-list li {
  display: block;
  position: relative;
  padding-right: 24px;
  padding-left: 0;
  text-align: right;
  direction: rtl;
}

body.rtl-ui .info-list li::before,
body.rtl-ui .feature-list li::before {
  position: absolute;
  right: 0;
  left: auto;
  top: 10px;
  margin-top: 0;
}

body.rtl-ui .auth-lang-dropdown .lang-menu {
  right: auto;
  left: 0;
}

body.rtl-ui .auth-lang-dropdown .lang-menu button {
  text-align: right;
}

.scroll-to-top{
  position: fixed;

  left: 18px;
  bottom: 26px;

  width: 42px;
  height: 36px;

  border: none;
  border-radius: 10px;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  background: linear-gradient(135deg,#ef4444,#dc2626);

  color: white;

  box-shadow:
    0 6px 16px rgba(0,0,0,0.25),
    0 3px 8px rgba(239,68,68,0.35);

  opacity: 0;
  visibility: hidden;

  transform: translateY(14px);
  transition: all 0.28s ease;

  z-index: 999;
  pointer-events: none;
}

.scroll-to-top svg{
  width: 16px;
  height: 16px;
}

.scroll-to-top.show{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-to-top:hover{
  transform: translateY(-2px);
  box-shadow:
    0 10px 22px rgba(0,0,0,0.3),
    0 6px 14px rgba(239,68,68,0.45);
}

.scroll-to-top:active{
  transform: scale(0.95);
}

@media (max-width: 640px) {
  .auth-topbar {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .brand-link {
    order: 1;
    justify-content: center;
    text-align: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
  }

  .brand-link span:last-child {
    align-items: center;
  }

  .auth-topbar-actions {
    order: 2;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .auth-topbar-actions nav {
    order: 1;
    justify-content: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
  }

  .auth-lang-dropdown {
    order: 2;
    align-self: center;
  }
}
