@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* =====================================================
   PREMIUM LOGIN PAGE
   ===================================================== */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  height: 100dvh;
  background: #0f172a;
  overflow: hidden;
  position: relative;
}

/* Animated Background Orbs */
.login-bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.login-bg-orb--1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #0d9488 0%, transparent 70%);
  top: -150px; left: -80px;
  animation: l-orb1 20s ease-in-out infinite;
}

.login-bg-orb--2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  bottom: -100px; right: -80px;
  animation: l-orb2 25s ease-in-out infinite;
}

.login-bg-orb--3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, #ec4899 0%, transparent 70%);
  top: 50%; left: 50%;
  animation: l-orb3 18s ease-in-out infinite;
}

@keyframes l-orb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, 30px) scale(1.1); }
  66% { transform: translate(-20px, 50px) scale(0.95); }
}
@keyframes l-orb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, -25px) scale(1.05); }
  66% { transform: translate(30px, -40px) scale(0.9); }
}
@keyframes l-orb3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.3); }
}

/* Main Wrapper */
.login-wrapper {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 44% 56%;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

/* =====================================================
   LEFT BRAND PANEL
   ===================================================== */

.login-brand {
  background: linear-gradient(160deg, #0d9488 0%, #0f766e 40%, #134e4a 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: 100dvh;
}

.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-brand::after {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.login-brand__inner {
  position: relative;
  z-index: 1;
  padding: 3rem 2.5rem;
  max-width: 460px;
}

/* Language Selector */
.language-selector-wrapper.login-language-selector {
  position: absolute !important;
  top: 20px !important;
  right: calc(56% + 20px) !important;
  z-index: 100;
}

/* Logo */
.login-brand__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 3rem;
}

.login-brand__logo-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-brand__logo-text {
  font-size: 18px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
}

/* Brand Content */
.login-brand__title {
  font-size: 2.75rem;
  font-weight: 800;
  color: white;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 1rem;
}

.login-brand__subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

/* Stats */
.login-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 2.5rem;
}

.login-stat {
  padding: 18px 14px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  transition: all 0.3s ease;
}

.login-stat:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.login-stat__number {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}

.login-stat__label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Trust */
.login-brand-trust {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-brand-trust__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.login-brand-trust__item i {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}

.login-brand-trust__divider {
  width: 1px; height: 16px;
  background: rgba(255, 255, 255, 0.12);
}

/* =====================================================
   RIGHT FORM PANEL
   ===================================================== */

.login-form-panel {
  background: white;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.login-form-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
}

.login-form-scroll::-webkit-scrollbar { width: 5px; }
.login-form-scroll::-webkit-scrollbar-track { background: #f8fafc; }
.login-form-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.login-form-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.login-form-wrapper {
  width: 100%;
  max-width: 420px;
}

/* Form Header */
.login-form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-form-header__icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  color: #0d9488;
  border: 1px solid #99f6e4;
}

.login-form-header__title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.login-form-header__subtitle {
  font-size: 0.9rem;
  color: #94a3b8;
  margin: 0;
}

/* Demo Info Card */
.login-demo {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid #e0f2fe;
}

.login-demo__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
}

.login-demo__header i {
  font-size: 14px;
  color: #f59e0b;
}

.login-demo__body {
  padding: 14px 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-demo__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-demo__label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.login-demo__value {
  font-size: 12px;
  color: #334155;
}

.login-demo__code {
  font-size: 12px;
  padding: 2px 10px;
  background: #0f172a;
  color: #5eead4;
  border-radius: 6px;
  font-weight: 600;
}

/* Login Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-field__label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.login-field__forgot {
  font-size: 12px;
  font-weight: 600;
  color: #0d9488;
  text-decoration: none;
  transition: color 0.2s;
}

.login-field__forgot:hover {
  color: #0f766e;
  text-decoration: underline;
}

.login-field__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-field__icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: #94a3b8;
  pointer-events: none;
  transition: color 0.2s;
  z-index: 1;
}

.login-field__input {
  width: 100%;
  height: 50px;
  padding: 0 14px 0 44px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: #0f172a;
  background: #fafbfc;
  transition: all 0.2s ease;
  outline: none;
}

.login-field__input::placeholder { color: #94a3b8; }

.login-field__input:hover {
  border-color: #cbd5e1;
  background: white;
}

.login-field__input:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.08);
  background: white;
}

.login-field__input-wrap:focus-within .login-field__icon {
  color: #0d9488;
}

.login-field__toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all 0.2s;
  z-index: 1;
}

.login-field__toggle:hover {
  color: #0d9488;
  background: #f0fdfa;
}

/* Submit Button */
.login-submit {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.4);
}

.login-submit:active { transform: translateY(0); }

.login-submit i {
  font-size: 18px;
  transition: transform 0.3s;
}

.login-submit:hover i {
  transform: translateX(4px);
}

.login-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: l-spin 0.6s linear infinite;
}

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

/* Links */
.login-links {
  text-align: center;
  margin-bottom: 20px;
}

.login-links__row {
  margin-bottom: 16px;
}

.login-links__item {
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.login-links__item:hover {
  color: #0d9488;
}

.login-links__item i {
  margin-right: 4px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.login-divider span {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.login-register {
  font-size: 14px;
  color: #64748b;
}

.login-register a {
  color: #0d9488;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.login-register a:hover {
  color: #0f766e;
  text-decoration: underline;
}

/* Form Trust */
.login-form-trust {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.login-form-trust i {
  font-size: 12px;
  color: #cbd5e1;
}

/* Alerts */
.login-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 16px;
  position: relative;
}

.login-alert--danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.login-alert--success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.login-alert--info {
  background: #f0fdfa;
  color: #0d9488;
  border: 1px solid #ccfbf1;
}

.login-alert__close {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.login-alert__close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

/* =====================================================
   LANGUAGE SELECTOR — Premium (matches header style)
   ===================================================== */

.topbar__lang { position: relative; }

.topbar__lang-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 40px; cursor: pointer;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(10px); color: rgba(255,255,255,0.9);
  font-size: 0.85rem; font-weight: 600; user-select: none;
  transition: all 0.2s ease;
}
.topbar__lang-btn:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.25); }
.topbar__lang-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(13,148,136,0.3); }

.topbar__lang-flag {
  width: 22px; height: 22px; object-fit: cover;
  border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); flex-shrink: 0;
}
.topbar__lang-text { white-space: nowrap; letter-spacing: -0.01em; }
.topbar__lang-chevron { font-size: 0.6rem; color: rgba(255,255,255,0.6); transition: transform 0.25s; margin-left: 2px; }
.topbar__lang-btn[aria-expanded="true"] .topbar__lang-chevron { transform: rotate(180deg); }

/* Dropdown panel */
.topbar__lang-dropdown {
  position: absolute; top: calc(100% + 10px); left: 0;
  list-style: none; margin: 0; padding: 8px;
  min-width: 220px; max-height: 420px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.12) transparent;
  background: white; border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08);
  opacity: 0; visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top left;
  transition: all 0.2s cubic-bezier(.4,0,.2,1);
  z-index: 1000;
}
.topbar__lang-dropdown::-webkit-scrollbar { width: 5px; }
.topbar__lang-dropdown::-webkit-scrollbar-track { background: transparent; margin: 10px 0; }
.topbar__lang-dropdown::-webkit-scrollbar-thumb { background: rgba(0,0,0,.10); border-radius: 10px; }
.topbar__lang-dropdown::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.20); }
.topbar__lang-dropdown.is-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* Dropdown header */
.topbar__lang-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 6px; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: #94a3b8; pointer-events: none;
}
.topbar__lang-header i { font-size: 0.82rem; opacity: 0.6; }
.topbar__lang-divider { height: 1px; margin: 4px 12px; background: #e2e8f0; }

/* Language items */
.topbar__lang-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  transition: all 0.15s ease; position: relative;
}
.topbar__lang-item:hover { background: rgba(13,148,136,0.06); }
.topbar__lang-item:active { transform: scale(0.98); }
.topbar__lang-item.is-active { background: rgba(13,148,136,0.08); }
.topbar__lang-item.is-active .topbar__lang-item-native { color: #0d9488; font-weight: 600; }

/* Flag thumbnails */
.topbar__lang-item-flag {
  width: 28px; height: 28px; object-fit: cover; border-radius: 50%;
  border: 2px solid #e2e8f0; flex-shrink: 0; transition: border-color 0.15s;
}
.topbar__lang-item.is-active .topbar__lang-item-flag { border-color: rgba(13,148,136,0.3); }

/* Two-line text */
.topbar__lang-item-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.topbar__lang-item-native { font-size: 0.88rem; font-weight: 500; line-height: 1.3; color: #0f172a; }
.topbar__lang-item-eng { font-size: 0.72rem; color: #94a3b8; line-height: 1.2; }

/* Checkmark */
.topbar__lang-item-check {
  font-size: 1rem; color: #0d9488; opacity: 0;
  transform: scale(0.5); transition: all 0.2s; margin-left: auto;
}
.topbar__lang-item.is-active .topbar__lang-item-check { opacity: 1; transform: scale(1); }

/* =====================================================
   LANGUAGE SWITCHER
   ===================================================== */
.lang-switch select { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1024px) {
  .login-brand__inner { padding: 2rem; }
  .login-brand__title { font-size: 2.25rem; }
}

@media (max-width: 768px) {
  body { height: auto; overflow: auto; }
  .login-wrapper {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .login-brand { display: none; height: auto; }
  .login-form-panel { height: auto; overflow: visible; }
  .login-form-scroll { overflow-y: visible; }
  .language-selector-wrapper.login-language-selector { display: none; }
  body { background: white; }
  .login-bg-orb { display: none; }
  .login-form-scroll {
    padding: 1.5rem;
    align-items: flex-start;
    padding-top: 3rem;
  }
}

@media (max-width: 480px) {
  .login-form-header__title { font-size: 1.4rem; }
  .login-form-scroll { padding: 1.25rem; padding-top: 2rem; }
  .login-submit { height: 48px; font-size: 14px; }
}
