/* =========================================================
   Login Page Stylesheet — Institutional Clean UI
   Responsive: Desktop, Laptop, Tablet, Android & iPhone
   ========================================================= */

:root {
  --navy-950: #091426;
  --navy-900: #0f213d;
  --navy-800: #163159;
  --navy-700: #1e4275;

  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  --white: #ffffff;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-accent: #dc2626;
  --danger-text: #991b1b;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  color: var(--slate-900);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Layout Shell ---------- */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(420px, 46%) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Left Panel: Institutional Identity (Desktop) ---------- */
.auth-brand {
  position: relative;
  background-color: var(--navy-900);
  color: var(--white);
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* Garis grid arsitektural sangat tipis (non-dekoratif) */
.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.auth-brand > * {
  position: relative;
  z-index: 1;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.brand-school {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--white);
  line-height: 1.3;
}

.brand-region {
  font-size: 12px;
  color: var(--slate-400);
  margin-top: 2px;
}

.brand-content {
  max-width: 440px;
  margin: auto 0;
  padding: 40px 0;
}

.brand-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 14px;
}

.brand-title {
  margin: 0 0 16px 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--white);
}

.brand-desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: #cbd5e1;
}

.brand-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
  margin-bottom: 4px;
}

.meta-value {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--white);
}

/* ---------- Right Panel: Form Area ---------- */
.auth-main {
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 32px;
}

.auth-box {
  width: 100%;
  max-width: 390px;
}

/* Compact header (hanya tampil di Tablet & Mobile) */
.mobile-brand {
  display: none;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--slate-200);
}

.mobile-brand .brand-mark {
  width: 42px;
  height: 42px;
  background-color: var(--navy-900);
  border-color: var(--navy-900);
  color: var(--white);
}

.mobile-brand-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.3;
}

.mobile-brand-sub {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 2px;
}

.form-head {
  margin-bottom: 28px;
}

.form-title {
  margin: 0 0 6px 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--slate-900);
}

.form-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--slate-500);
  line-height: 1.5;
}

/* Alert Error */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 22px;
  background-color: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-left: 3px solid var(--danger-accent);
  border-radius: var(--radius-md);
  color: var(--danger-text);
  font-size: 13.5px;
  line-height: 1.45;
}

.auth-alert svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--danger-accent);
}

/* Form Controls */
.field-group {
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 7px;
}

.input-wrap {
  position: relative;
}

.field-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--slate-900);
  background-color: var(--white);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.field-input::placeholder {
  color: var(--slate-400);
}

.field-input:hover {
  border-color: var(--slate-400);
}

.field-input:focus {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(30, 66, 117, 0.14);
}

.field-input.has-toggle {
  padding-right: 46px;
}

.pwd-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--slate-500);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.pwd-toggle:hover {
  color: var(--slate-900);
  background-color: var(--slate-100);
}

.pwd-toggle:focus-visible {
  outline: 2px solid var(--navy-700);
  outline-offset: 1px;
}

/* Primary Submit Button */
.btn-submit {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  padding: 0 20px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--white);
  background-color: var(--navy-900);
  border: 1px solid var(--navy-900);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.btn-submit:hover {
  background-color: var(--navy-800);
  border-color: var(--navy-800);
}

.btn-submit:active {
  transform: translateY(1px);
  background-color: var(--navy-950);
}

.btn-submit:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

/* Footer Note */
.auth-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--slate-200);
  font-size: 12.5px;
  color: var(--slate-500);
  line-height: 1.55;
}

.auth-copyright {
  margin-top: 8px;
  font-size: 12px;
  color: var(--slate-400);
}

/* =========================================================
   Responsive Breakpoints (Desktop, Tablet, Android & iPhone)
   ========================================================= */

/* Laptop kecil (992px - 1199px) */
@media (max-width: 1199.98px) {
  .auth-brand {
    padding: 40px 36px;
  }
  .brand-title {
    font-size: 28px;
  }
}

/* Tablet (576px - 991px): Banner Navy di atas + Kartu Form melayang */
@media (max-width: 991.98px) {
  .auth-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--slate-100);
  }
  .auth-brand {
    display: flex;
    padding: calc(28px + env(safe-area-inset-top)) 28px 64px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: flex-start;
  }
  .brand-content {
    max-width: 560px;
    margin: 22px 0 0;
    padding: 0;
  }
  .brand-kicker {
    margin-bottom: 8px;
  }
  .brand-title {
    font-size: 26px;
    margin-bottom: 10px;
  }
  .brand-desc {
    font-size: 13.5px;
    line-height: 1.55;
  }
  .brand-meta {
    display: none;
  }
  .mobile-brand {
    display: none !important;
  }
  .auth-main {
    position: relative;
    z-index: 2;
    flex: 1;
    background-color: transparent;
    justify-content: flex-start;
    margin-top: -38px;
    padding: 0 20px calc(32px + env(safe-area-inset-bottom));
  }
  .auth-box {
    max-width: 440px;
    background-color: var(--white);
    padding: 30px 28px;
    border-radius: 14px;
    border: 1px solid var(--slate-200);
    box-shadow: 0 12px 32px rgba(9, 20, 38, 0.09);
  }
}

/* Android & iPhone (<= 575px): Header Navy + Lembar Form Full-Width */
@media (max-width: 575.98px) {
  .auth-layout {
    background-color: var(--navy-900);
  }
  .auth-brand {
    padding: calc(22px + env(safe-area-inset-top)) 20px 38px;
    border-bottom: none;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
  }
  .brand-school {
    font-size: 13.5px;
  }
  .brand-region {
    font-size: 11.5px;
  }
  .brand-content {
    margin-top: 18px;
  }
  .brand-kicker {
    font-size: 10.5px;
    margin-bottom: 6px;
  }
  .brand-title {
    font-size: 21px;
    line-height: 1.25;
    margin-bottom: 0;
  }
  .brand-desc {
    display: none;
  }
  .auth-main {
    margin-top: -18px;
    padding: 26px 20px calc(28px + env(safe-area-inset-bottom));
    background-color: var(--white);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 24px rgba(9, 20, 38, 0.16);
  }
  .auth-box {
    max-width: 100%;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
  }
  .form-head {
    margin-bottom: 22px;
  }
  .form-title {
    font-size: 21px;
  }
  /* 16px mencegah auto-zoom di iPhone Safari */
  .field-input {
    height: 48px;
    font-size: 16px;
  }
  .btn-submit {
    height: 50px;
    font-size: 15px;
  }
}