/* Login page, moved from the inline <style> in app/Views/login.php. */
/* Poppins - Self-hosted fonts */
@font-face {
  font-display: swap;
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 300;
  src: url('../../fonts/poppins/poppins-v24-latin-300.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  src: url('../../fonts/poppins/poppins-v24-latin-regular.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  src: url('../../fonts/poppins/poppins-v24-latin-500.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  src: url('../../fonts/poppins/poppins-v24-latin-600.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  src: url('../../fonts/poppins/poppins-v24-latin-700.woff2') format('woff2');
}

:root {
  --brand: #C74634;
  --brand-dark: #9F3B2A;
  --brand-soft: rgba(199, 70, 52, 0.08);
  --navy: #2B3440;
  --navy-dark: #1d242d;
  --cream: #F4F1EA;
  --cream-2: #ECE7DC;
  --ink: #1f2329;
  --muted: #6b7280;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--ink);
  background: #fff;
}

/* ---------- Split layout ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
}

/* ===== Brand panel (desktop only) ===== */
.auth-brand {
  position: relative;
  flex: 0 0 48%;
  max-width: 48%;
  padding: 3rem;
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  animation: slideInLeft 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Soft diagonal cream facets, top area */
.auth-brand::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -10%;
  width: 80%;
  height: 70%;
  background: var(--cream-2);
  clip-path: polygon(20% 0, 100% 0, 100% 100%, 55% 60%);
  opacity: 0.7;
  pointer-events: none;
}

/* CSS "architecture" — angular skyline at the bottom (no photo) */
.auth-arch {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  pointer-events: none;
  z-index: 0;
}

.auth-arch span {
  position: absolute;
  bottom: 0;
  background: linear-gradient(180deg, #cfc9bd 0%, #b9b2a4 100%);
}

.auth-arch span:nth-child(1) { left: 6%;  width: 13%; height: 60%; transform: skewX(-4deg); }
.auth-arch span:nth-child(2) { left: 19%; width: 16%; height: 86%; background: linear-gradient(180deg, #c4bdb0, #a99f8f); }
.auth-arch span:nth-child(3) { left: 35%; width: 11%; height: 72%; transform: skewX(3deg); }
.auth-arch span:nth-child(4) { left: 47%; width: 18%; height: 100%; background: linear-gradient(180deg, #cfc9bd, #b3aa9a); }
.auth-arch span:nth-child(5) { left: 66%; width: 12%; height: 64%; }
.auth-arch span:nth-child(6) { left: 78%; width: 16%; height: 80%; transform: skewX(-3deg); background: linear-gradient(180deg, #c4bdb0, #a99f8f); }

/* faint vertical mullions to read as glass facade */
.auth-arch span::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(255,255,255,0.25) 1px, transparent 1px);
  background-size: 14px 100%;
}

.auth-brand__inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
}

.auth-brand__logo-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  width: 100%;
  max-width: 420px;
  align-self: center;
  box-shadow: 0 18px 45px rgba(43, 52, 64, 0.14);
}

/* phinma_logo_all.png is one image (main logo on top, 4 sub-brands
   on the bottom). Crop it into two halves so we can put a separator
   line between them — no extra image files needed. */
.auth-brand__sublogos {
  width: 100%;
  height: auto;
  display: block;
}

.auth-brand__tagline {
  margin-top: 2.25rem;
  width: 100%;
  max-width: 420px;
  align-self: center;
  animation: fadeUp 0.6s ease 0.4s both;
}

.auth-brand__tagline h2 {
  font-weight: 700;
  font-size: 2rem;
  margin: 0;
}

.auth-brand__tagline .accent-line {
  width: 48px;
  height: 3px;
  background: var(--brand);
  border-radius: 2px;
  margin: 0.6rem 0 0.9rem;
}

.auth-brand__tagline p {
  margin: 0;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.95rem;
}

/* Trust chip bottom-left */
.auth-brand__chip {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(43, 52, 64, 0.08);
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  color: var(--navy);
  box-shadow: 0 6px 20px rgba(43, 52, 64, 0.1);
}

.auth-brand__chip i {
  color: var(--brand);
}

/* ===== Form panel ===== */
.auth-form {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: #fff;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.auth-card__mobile-logo {
  display: none;
  margin-bottom: 1.5rem;
}

.auth-card__mobile-logo img {
  max-width: 200px;
  height: auto;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.auth-title {
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 2rem;
}

.form-block {
  text-align: left;
}

.form-label {
  font-weight: 500;
  font-size: 0.86rem;
  margin-bottom: 0.4rem;
}

.input-group-text {
  background: #fff;
  border-right: 0;
  color: #9ca3af;
}

.form-control {
  border-left: 0;
  min-height: 50px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control:focus,
.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text {
  border-color: var(--navy);
  box-shadow: none;
}

.input-group:focus-within {
  box-shadow: 0 0 0 0.18rem rgba(43, 52, 64, 0.1);
  border-radius: 0.5rem;
}

.input-group.is-invalid-group .form-control,
.input-group.is-invalid-group .input-group-text {
  border-color: #dc3545;
}

.btn-toggle-pass {
  border-left: 0;
  background: #fff;
  color: #9ca3af;
}

.btn-toggle-pass:hover {
  color: var(--navy);
}

/* Sign In — dark navy with arrow */
.btn-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 50px;
  background-color: var(--navy);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: background-color 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
}

.btn-signin:hover {
  background-color: var(--navy-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(43, 52, 64, 0.3);
}

.btn-signin:active,
.btn-signin:focus {
  background-color: var(--navy-dark) !important;
  color: #fff;
  transform: translateY(0);
  box-shadow: none !important;
}

.btn-signin .arrow {
  transition: transform 0.18s ease;
}

.btn-signin:hover .arrow {
  transform: translateX(4px);
}

.btn-signin:disabled {
  opacity: 0.85;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #9ca3af;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  margin: 1.4rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.g_id_signin {
  max-width: 100%;
}

.auth-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 1.75rem;
}

.auth-trust i {
  color: #198754;
}

.auth-foot {
  text-align: center;
  color: #9ca3af;
  font-size: 0.78rem;
  margin-top: 0.5rem;
}

/* Spinners */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid var(--navy);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn-spinner {
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake { animation: shake 0.4s ease; }

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-brand, .auth-card, .auth-brand__tagline { animation: simpleFade 0.4s ease both; }
  .shake { animation: none !important; }
  .btn-signin, .form-control, .btn-signin .arrow { transition: none !important; }
}

@keyframes simpleFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Responsive: hide brand panel ---------- */
@media (max-width: 991.98px) {
  .auth-brand { display: none; }
  .auth-card__mobile-logo { display: block; }
}
