:root {
  --login-ink: #102a4c;
  --login-pink: #cf1c5b;
  --login-cyan: #42b9df;
  --login-field: #edf5ff;
}

.auth-page {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.2fr) minmax(300px, .8fr);
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 78%, rgba(207, 28, 91, .12), transparent 25%),
    radial-gradient(circle at 70% 28%, rgba(66, 185, 223, .12), transparent 28%),
    linear-gradient(135deg, #fff 0%, #f8fbff 58%, #edf5fb 100%);
}

.auth-page::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 53%;
  width: min(47vw, 760px);
  height: min(92vh, 920px);
  transform: translate(-50%, -50%);
  background: url("/go-slim-ribbon.png") center / contain no-repeat;
  filter: drop-shadow(0 32px 38px rgba(38, 92, 128, .17));
  pointer-events: none;
}

.auth-card {
  z-index: 2;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  width: min(470px, calc(100% - 64px));
  margin: 46px auto 0;
  padding: 0;
  gap: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-card > svg {
  width: 36px;
  height: 36px;
  margin: 0 0 10px;
  color: var(--login-pink);
}

.auth-card h2 {
  margin: 0;
  color: var(--login-ink);
  font-size: clamp(37px, 3.2vw, 54px);
  line-height: 1.02;
  letter-spacing: -.035em;
}

.auth-card > p {
  max-width: 460px;
  margin: 2px 0 13px;
  color: #60718a;
  font-size: 16px;
  line-height: 1.55;
}

.auth-card .field {
  gap: 8px;
  color: var(--login-ink);
  font-size: 14px;
  font-weight: 700;
}

.auth-card .field input {
  min-height: 64px;
  padding: 15px 54px 15px 20px;
  border: 1px solid #ccd9e8;
  border-radius: 15px;
  background-color: rgba(237, 245, 255, .94);
  color: var(--login-ink);
  font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.auth-card .field input[type="email"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23677991' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
}

.auth-card .field input:focus {
  border-color: var(--login-cyan);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(66, 185, 223, .16);
}

.password-toggle {
  right: 13px;
  bottom: 14px;
}

.auth-card .primary {
  min-height: 64px;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #c91858, #df2568);
  box-shadow: 0 16px 32px rgba(201, 29, 92, .2);
  font-size: 17px;
  letter-spacing: .01em;
}

.auth-card .primary::after {
  content: "\2192";
  display: inline-block;
  margin-left: 14px;
  font-size: 23px;
  line-height: 0;
  transition: transform .18s ease;
}

.auth-card .primary:hover::after { transform: translateX(4px); }

.auth-card a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  margin-top: 6px;
  padding: 12px 52px;
  border: 1px solid #c7d2df;
  border-radius: 999px;
  color: var(--login-ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.auth-card a::before {
  content: "";
  position: absolute;
  left: 22px;
  width: 21px;
  height: 24px;
  background: var(--login-pink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2h9l5 5v15H6V2Zm8 2H8v16h10V8h-4V4Zm2 1.4V6h.6L16 5.4ZM10 11h6v2h-6v-2Zm0 4h6v2h-6v-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2h9l5 5v15H6V2Zm8 2H8v16h10V8h-4V4Zm2 1.4V6h.6L16 5.4ZM10 11h6v2h-6v-2Zm0 4h6v2h-6v-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.auth-card a:hover {
  transform: translateY(-1px);
  border-color: var(--login-pink);
  background: rgba(255, 255, 255, .76);
}

.auth-brand {
  position: relative;
  z-index: 2;
  grid-column: 3;
  grid-row: 1;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  grid-auto-rows: min-content;
  align-content: center;
  align-self: stretch;
  column-gap: 16px;
  padding: 0 clamp(34px, 5vw, 96px) 0 10px;
  overflow: visible;
  color: var(--login-ink);
  background: transparent;
}

.auth-brand::before {
  content: "KLINIK SAFWA";
  position: static;
  z-index: auto;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  color: var(--login-ink);
  font-size: clamp(15px, 1.45vw, 23px);
  font-weight: 700;
  letter-spacing: .07em;
  white-space: nowrap;
}

.auth-brand::after { content: none; }

.auth-brand .auth-logo {
  grid-column: 1;
  grid-row: 1;
  width: 82px;
  height: 82px;
  margin: 0;
  object-fit: cover;
  object-position: center 63%;
  filter: none;
}

.auth-brand strong {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 22px;
  color: var(--login-pink);
  font: 600 italic clamp(58px, 5.4vw, 92px)/.95 "Playfair Display", Georgia, serif;
  letter-spacing: -.045em;
}

.auth-brand p {
  grid-column: 1 / -1;
  grid-row: 3;
  max-width: 360px;
  margin: 24px 0 0;
  color: var(--login-ink);
  font-size: clamp(17px, 1.45vw, 23px);
  line-height: 1.45;
}

#language-switcher {
  top: 28px !important;
  right: auto !important;
  left: clamp(32px, 5.8vw, 100px) !important;
  z-index: 5 !important;
  border-color: #c8d6e4 !important;
  background: rgba(255, 255, 255, .86) !important;
  backdrop-filter: blur(12px);
}

@media (max-width: 1180px) {
  .auth-page {
    grid-template-columns: minmax(350px, .95fr) minmax(330px, 1fr) minmax(255px, .7fr);
  }
  .auth-page::before { left: 54%; width: 45vw; }
  .auth-card { width: min(430px, calc(100% - 44px)); }
  .auth-brand { grid-template-columns: 66px 1fr; padding-right: 28px; }
  .auth-brand .auth-logo { width: 66px; height: 66px; }
}

@media (max-width: 900px) {
  .auth-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: 100svh;
    padding: 78px 20px 42px;
    overflow: hidden;
  }

  .auth-page::before {
    top: 25px;
    right: -110px;
    left: auto;
    width: 360px;
    height: 360px;
    transform: none;
    opacity: .2;
    filter: none;
  }

  .auth-brand {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 54px auto;
    justify-content: start;
    width: min(560px, 100%);
    margin: 0 auto 34px;
    padding: 0;
  }

  .auth-brand .auth-logo { width: 54px; height: 54px; }
  .auth-brand::before { font-size: 15px; }
  .auth-brand strong { margin-top: 14px; font-size: 48px; }
  .auth-brand p { max-width: 300px; margin-top: 10px; font-size: 15px; }

  .auth-card {
    grid-column: 1;
    grid-row: 2;
    width: min(560px, 100%);
    margin: 0 auto;
    padding: 30px 26px 26px;
    border: 1px solid rgba(204, 217, 232, .78);
    border-radius: 26px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 24px 60px rgba(49, 82, 111, .12);
    backdrop-filter: blur(18px);
  }

  .auth-card h2 { font-size: 36px; }

  #language-switcher {
    top: 16px !important;
    right: 16px !important;
    left: auto !important;
  }
}

@media (max-width: 480px) {
  .auth-page { padding: 70px 12px 24px; }
  .auth-page::before { right: -145px; width: 320px; height: 320px; }
  .auth-brand { grid-template-columns: 46px auto; margin-bottom: 24px; padding-inline: 8px; }
  .auth-brand .auth-logo { width: 46px; height: 46px; }
  .auth-brand::before { font-size: 13px; }
  .auth-brand strong { font-size: 42px; }
  .auth-brand p { max-width: 260px; font-size: 14px; }
  .auth-card { padding: 26px 18px 20px; gap: 14px; border-radius: 22px; }
  .auth-card > svg { width: 31px; height: 31px; margin-bottom: 5px; }
  .auth-card h2 { font-size: 32px; }
  .auth-card > p { margin-bottom: 7px; font-size: 14px; }
  .auth-card .field input { min-height: 58px; border-radius: 13px; }
  .auth-card .primary, .auth-card a { min-height: 58px; }
  .auth-card a { padding-inline: 45px; font-size: 14px; }
  #language-switcher { top: 12px !important; right: 12px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card .primary, .auth-card .primary::after, .auth-card a { transition: none; }
}
