:where([class^="ri-"])::before {
  content: "\f3c2";
}

body.hide-content { opacity: 0 !important; }

/* Custom checkbox (Remember me) */
.custom-checkbox input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.custom-checkbox .checkbox-box {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 1rem; height: 1rem; border-radius: 0.25rem; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.4);
  transition: all 0.15s ease;
}
.custom-checkbox .checkbox-box .checkbox-icon { display: none; }
.custom-checkbox input[type="checkbox"]:checked + .checkbox-box {
  background-color: #3A0F65; border-color: #3A0F65;
}
.custom-checkbox input[type="checkbox"]:checked + .checkbox-box .checkbox-icon { display: block; }
.custom-checkbox:hover .checkbox-box { transform: scale(1.05); }

/* Live field validation states */
.input-field.field-valid {
  border-color: rgba(74, 222, 128, 0.6) !important;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.15);
}
.input-field.field-error {
  border-color: rgba(248, 113, 113, 0.6) !important;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.15);
}
.field-feedback {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.field-feedback.is-valid { color: rgba(74, 222, 128, 0.9); }
.field-feedback.is-error { color: rgba(248, 113, 113, 0.9); }
.field-feedback i { font-size: 0.875rem; }

/* ==========================================================================
   BASE — Gradient Background
   ========================================================================== */
body {
  padding-bottom: env(safe-area-inset-bottom);
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  background: linear-gradient(135deg, #3A0F65 0%, #4F46E5 50%, #3A0F65 100%);
  min-height: 100vh;
  animation: gradientShift 15s ease infinite;
  background-size: 400% 400%;
  margin: 0;
}

/* ==========================================================================
   2-COLUMN AUTH LAYOUT
   ========================================================================== */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* --- Left column: Branding --- */
.auth-branding {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 3rem;
  overflow: hidden;
  z-index: 2;
}
.auth-branding .geo-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.branding-header {
  position: relative;
  z-index: 1;
  margin-bottom: 2rem;
}
.branding-details {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.branding-footer {
  position: relative;
  z-index: 1;
  margin-top: 1.5rem;
}

/* --- Right column: Form wrapper --- */
.auth-form-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   GLASSMORPHISM
   ========================================================================== */
.glassmorphism {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */
.input-field {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.input-field:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}
.input-field:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-primary {
  background: linear-gradient(45deg, #3A0F65, #4F46E5);
  background-size: 200% 200%;
  animation: gradientAnimation 3s ease infinite;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(58, 15, 101, 0.4);
}
.btn-primary:active {
  transform: translateY(0);
}

.ripple {
  position: relative;
  overflow: hidden;
}
.ripple::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}
.ripple:active::before {
  width: 300px; height: 300px;
}

/* ==========================================================================
   SOCIAL BUTTONS
   ========================================================================== */
.social-btn {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.social-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}
.social-btn:active {
  transform: translateY(0);
}

/* ==========================================================================
   TOGGLE SWITCH
   ========================================================================== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.toggle-slider:before {
  position: absolute; content: "";
  height: 18px; width: 18px;
  left: 2px; bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(45deg, #3A0F65, #4F46E5);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   SEPARATOR
   ========================================================================== */
.separator {
  position: relative;
  text-align: center;
  margin: 2rem 0;
}
.separator::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
}
.separator span {
  background: rgba(255, 255, 255, 0.1);
  padding: 0 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  backdrop-filter: blur(10px);
  border-radius: 20px;
}

/* ==========================================================================
   GEOMETRIC BACKGROUND — Abstract animated shapes
   ========================================================================== */

/* --- Rotating rings --- */
.geo-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.geo-ring--lg {
  width: 500px; height: 500px;
  top: -120px; right: -160px;
  animation: geoRotate 45s linear infinite;
}
.geo-ring--md {
  width: 320px; height: 320px;
  bottom: -60px; left: -80px;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.05);
  animation: geoRotate 35s linear infinite reverse;
}
.geo-ring--sm {
  width: 180px; height: 180px;
  top: 40%; left: 55%;
  border-color: rgba(255, 255, 255, 0.06);
  animation: geoRotate 25s linear infinite;
}

/* --- Floating diagonal lines --- */
.geo-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform-origin: center;
}
.geo-line--1 {
  width: 200px;
  top: 15%; left: 5%;
  transform: rotate(35deg);
  animation: geoLineFloat1 8s ease-in-out infinite;
}
.geo-line--2 {
  width: 150px;
  top: 35%; right: 10%;
  transform: rotate(-20deg);
  animation: geoLineFloat2 10s ease-in-out 1s infinite;
}
.geo-line--3 {
  width: 120px;
  bottom: 25%; left: 15%;
  transform: rotate(55deg);
  animation: geoLineFloat3 7s ease-in-out 2s infinite;
}
.geo-line--4 {
  width: 180px;
  top: 60%; left: 60%;
  transform: rotate(-40deg);
  animation: geoLineFloat4 9s ease-in-out 0.5s infinite;
}
.geo-line--5 {
  width: 100px;
  top: 80%; left: 40%;
  transform: rotate(15deg);
  animation: geoLineFloat5 11s ease-in-out 3s infinite;
}

/* --- Dot grid --- */
.geo-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  animation: geoDrift 20s linear infinite;
}

/* --- Glowing orbs --- */
.geo-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}
.geo-orb--1 {
  width: 200px; height: 200px;
  top: 10%; left: 20%;
  background: rgba(58, 15, 101, 0.2);
  animation: geoOrb 12s ease-in-out infinite;
}
.geo-orb--2 {
  width: 160px; height: 160px;
  bottom: 15%; right: 10%;
  background: rgba(79, 70, 229, 0.15);
  animation: geoOrb 15s ease-in-out 3s infinite;
}

/* --- Cross shapes --- */
.geo-cross {
  position: absolute;
  width: 24px; height: 24px;
}
.geo-cross::before,
.geo-cross::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
}
.geo-cross::before {
  width: 100%; height: 1px;
  top: 50%; left: 0;
}
.geo-cross::after {
  width: 1px; height: 100%;
  left: 50%; top: 0;
}
.geo-cross--1 {
  top: 22%; left: 70%;
  animation: geoCrossSpin 20s linear infinite;
}
.geo-cross--2 {
  bottom: 30%; left: 30%;
  width: 18px; height: 18px;
  animation: geoCrossSpin 15s linear infinite reverse;
}

/* --- Geo keyframes --- */
@keyframes geoRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes geoLineFloat1 {
  0%, 100% { opacity: 0.6; transform: rotate(35deg) translateY(0); }
  50%      { opacity: 1;   transform: rotate(35deg) translateY(-15px); }
}
@keyframes geoLineFloat2 {
  0%, 100% { opacity: 0.6; transform: rotate(-20deg) translateY(0); }
  50%      { opacity: 1;   transform: rotate(-20deg) translateY(-12px); }
}
@keyframes geoLineFloat3 {
  0%, 100% { opacity: 0.6; transform: rotate(55deg) translateY(0); }
  50%      { opacity: 1;   transform: rotate(55deg) translateY(-18px); }
}
@keyframes geoLineFloat4 {
  0%, 100% { opacity: 0.6; transform: rotate(-40deg) translateY(0); }
  50%      { opacity: 1;   transform: rotate(-40deg) translateY(-10px); }
}
@keyframes geoLineFloat5 {
  0%, 100% { opacity: 0.6; transform: rotate(15deg) translateY(0); }
  50%      { opacity: 1;   transform: rotate(15deg) translateY(-14px); }
}
@keyframes geoDrift {
  from { background-position: 0 0; }
  to { background-position: 28px 28px; }
}
@keyframes geoOrb {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  33%      { transform: translate(20px, -15px) scale(1.1); opacity: 0.9; }
  66%      { transform: translate(-10px, 10px) scale(0.95); opacity: 0.7; }
}
@keyframes geoCrossSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   PASSWORD TOGGLE
   ========================================================================== */
.password-toggle {
  cursor: pointer;
  transition: color 0.3s ease;
}
.password-toggle:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   ERROR MESSAGE
   ========================================================================== */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  backdrop-filter: blur(10px);
}

/* ==========================================================================
   LOADING SPINNER
   ========================================================================== */
.loading-spinner {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 2px solid white;
  width: 20px; height: 20px;
  animation: spin 1s linear infinite;
}

/* ==========================================================================
   FLAG SELECT COMPONENT
   ========================================================================== */
.flag-select {
  position: relative;
}
.flag-select__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 2.5rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  font-size: 0.875rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.flag-select__trigger:hover {
  background: rgba(255, 255, 255, 0.08);
}
.flag-select__trigger:focus,
.flag-select--open .flag-select__trigger {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
  outline: none;
}
.flag-select__trigger-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  transition: transform 0.2s ease;
  pointer-events: none;
}
.flag-select--open .flag-select__trigger-arrow {
  transform: translateY(-50%) rotate(180deg);
}
.flag-select__flag {
  width: 22px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}
.flag-select__placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.flag-select__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 50;
  background: rgba(30, 20, 60, 0.95);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
  max-height: 260px;
  display: none;
  overflow: hidden;
  animation: flagDropIn 0.15s ease-out;
}
.flag-select--open .flag-select__dropdown {
  display: block;
}
@keyframes flagDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.flag-select__search {
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #fff;
  font-size: 0.8125rem;
  outline: none;
}
.flag-select__search::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.flag-select__list {
  max-height: 210px;
  overflow-y: auto;
  padding: 4px;
}
.flag-select__list::-webkit-scrollbar { width: 4px; }
.flag-select__list::-webkit-scrollbar-track { background: transparent; }
.flag-select__list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.flag-select__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.8);
  transition: background 0.15s;
}
.flag-select__item:hover {
  background: rgba(255, 255, 255, 0.1);
}
.flag-select__item--selected {
  background: rgba(58, 15, 101, 0.3);
  color: #fff;
}
.flag-select__item--hidden {
  display: none;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes gradientAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.fade-in {
  animation: fadeIn 0.8s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.slide-up {
  animation: slideUp 0.6s ease-out;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   RESPONSIVE — Mobile (<1024px)
   ========================================================================== */
@media (max-width: 1023px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .auth-branding {
    position: relative;
    height: auto;
    padding: 1.25rem 1.5rem;
    flex-direction: row;
    align-items: center;
    gap: 0;
  }
  .auth-branding .geo-bg {
    display: none;
  }
  .branding-header {
    margin-bottom: 0;
  }
  .branding-details {
    display: none;
  }
  .branding-footer {
    display: none;
  }
  .auth-form-wrapper {
    min-height: 0;
    padding: 1.5rem 1rem 3rem;
    flex: 1;
  }
}

@media (max-width: 480px) {
  .auth-form-wrapper {
    padding: 1rem 0.75rem 2rem;
  }
}
