@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============ RESET & BASE ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #1e293b;
  background: #f1f5f9;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ LAYOUT ============ */
.login-page {
  display: flex;
  min-height: 100vh;
}

/* Left branding panel */
.login-brand-panel {
  flex: 0 0 45%;
  max-width: 45%;
  background: linear-gradient(160deg, #4C64DD 0%, #2a1854 40%, #0d0b1a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.login-brand-panel::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(162,116,255,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.login-brand-panel::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(162,116,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.brand-content {
  position: relative;
  z-index: 1;
  text-align: left;
  max-width: 440px;
}

.brand-icon {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 2rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
}

.brand-icon svg {
  width: 36px;
  height: 36px;
  color: #a274ff;
}

.brand-title {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
  letter-spacing: -0.025em;
}

.brand-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.brand-dynamic-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.5rem;
}

.brand-dynamic-desc {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2.5rem;
  text-align: left;
  width: 100%;
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
}

.brand-feature-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-feature-icon svg {
  width: 18px;
  height: 18px;
  color: #a274ff;
}

/* Right form panel */
.login-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: #ffffff;
  position: relative;
}

.login-form-container {
  width: 100%;
  max-width: 420px;
}

/* Logo area */
.login-logo {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 2rem;
}

.login-logo img {
  max-height: 44px;
  object-fit: contain;
}

/* Heading */
.login-heading {
  margin-bottom: 2rem;
}

.login-heading h1 {
  font-size: 1.625rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.375rem;
  letter-spacing: -0.025em;
}

.login-heading p {
  font-size: 0.9375rem;
  color: #64748b;
}

/* ============ ALERTS ============ */
.login-alert {
  margin-bottom: 1.25rem;
}

.alert {
  padding: 0.875rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  border: none;
}

.alert-danger {
  background: #fef2f2;
  color: #dc2626;
  border-left: 3px solid #dc2626;
}

.alert-success {
  background: #f0fdf4;
  color: #16a34a;
  border-left: 3px solid #16a34a;
}

.alert-dismissible .btn-close {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  font-size: 10px;
  padding: 0.5rem;
  opacity: 0.5;
  filter: none;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  line-height: 1;
}

.alert-dismissible .btn-close::after {
  content: '\2715';
  font-size: 14px;
}

.alert-body {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============ FORM ============ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group .label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
  letter-spacing: 0.01em;
}

.form-control {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  font-size: 0.9375rem;
  font-weight: 400;
  color: #1e293b;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.2s ease;
  outline: none;
  font-family: inherit;
}

.form-control::placeholder {
  color: #94a3b8;
  font-size: 0.875rem;
}

.form-control:hover {
  border-color: #cbd5e1;
}

.form-control:focus {
  border-color: #a274ff;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(162,116,255,0.1);
}

/* Password wrapper */
.password_wrap {
  position: relative;
}

.view_ctrl {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.view_ctrl:hover {
  color: #a274ff;
}

.view_ctrl iconify-icon {
  font-size: 20px;
}

.password_wrap .form-control {
  padding-right: 48px;
}

/* Error callout */
.callout-danger {
  background: #fef2f2;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}

.error_paragraph {
  font-size: 0.8125rem;
  color: #dc2626;
}

/* ============ RADIO BUTTONS (SaaS Demo) ============ */
.login-radio-section {
  margin-bottom: 1.25rem;
}

.login-as {
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  color: #374151 !important;
  display: block;
  margin-bottom: 0.5rem;
}

.login-radio-wrap {
  display: flex;
  gap: 1rem;
}

[type="radio"]:checked,
[type="radio"]:not(:checked) {
  position: absolute;
  left: -9999px;
}

[type="radio"]:checked + label,
[type="radio"]:not(:checked) + label {
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  line-height: 22px;
  display: inline-block;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

[type="radio"]:checked + label {
  color: #1e293b;
}

[type="radio"]:checked + label:before,
[type="radio"]:not(:checked) + label:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  background: #fff;
  transition: border-color 0.2s;
}

[type="radio"]:checked + label:before {
  border-color: #a274ff;
}

[type="radio"]:checked + label:after,
[type="radio"]:not(:checked) + label:after {
  content: '';
  width: 10px;
  height: 10px;
  position: absolute;
  top: 5px;
  left: 5px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

[type="radio"]:not(:checked) + label:after {
  background: transparent;
  opacity: 0;
  transform: scale(0);
}

[type="radio"]:checked + label:after {
  background: #a274ff;
  opacity: 1;
  transform: scale(1);
}

/* ============ BUTTONS ============ */
.login-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
}

.btn-login-primary {
  background: linear-gradient(135deg, #a274ff, #4C64DD);
  color: #ffffff;
}

.btn-login-primary:hover {
  background: #8b5cf6;
  box-shadow: 0 4px 12px rgba(162,116,255,0.35);
  color: #ffffff;
}

.btn-login-primary:active {
  transform: scale(0.98);
}

.btn-login-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1.5px solid #e2e8f0;
}

.btn-login-secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-login-outline {
  background: transparent;
  color: #a274ff;
  border: 1.5px solid #a274ff;
}

.btn-login-outline:hover {
  background: rgba(162,116,255,0.05);
  color: #8b5cf6;
}

.login-secondary-actions {
  display: flex;
  gap: 0.75rem;
}

.login-secondary-actions .btn-login {
  flex: 1;
  height: 42px;
  font-size: 0.8125rem;
}

/* Forgot password */
.forgot-link {
  text-align: right;
  margin-bottom: 1.5rem;
}

.forgot-link a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #a274ff;
  text-decoration: none;
  transition: color 0.2s;
}

.forgot-link a:hover {
  color: #8b5cf6;
  text-decoration: underline;
}

/* ============ FOOTER ============ */
.login-footer {
  margin-top: 2.5rem;
  text-align: left;
}

.login-footer p {
  font-size: 0.8125rem;
  color: #94a3b8;
}

.login-footer a {
  color: #a274ff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.login-footer a:hover {
  color: #8b5cf6;
  text-decoration: underline;
}

/* ============ BUY NOW (Demo mode) ============ */
.buy-now {
  position: fixed;
  z-index: 999;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: #dc2626;
  color: #fff;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 20px rgba(220,38,38,0.4);
  transition: all 0.2s;
}

.buy-now:hover {
  background: #b91c1c;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(220,38,38,0.5);
}

/* Input container for JS alerts */
.input-container_custom {
  margin-bottom: 0;
}

.input-container_custom:empty {
  display: none;
}

/* ============ SELECT2 OVERRIDES ============ */
.select2-container--default .select2-selection--single {
  height: 48px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 48px;
  font-size: 0.9375rem;
  color: #1e293b;
  padding-left: 1rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 48px;
  right: 8px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1.5px solid #a274ff;
  border-radius: 8px;
  padding: 6px 10px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #ede9fe;
  color: #7c3aed;
}

.select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #ddd6fe;
  color: #7c3aed;
}

.select2-container--default .select2-results > .select2-results__options li {
  font-size: 0.875rem;
  color: #475569;
  padding: 8px 12px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 991.98px) {
  .login-brand-panel {
    display: none;
  }

  .login-form-panel {
    background: #f1f5f9;
  }

  .login-form-container {
    background: #ffffff;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.06);
  }
}

@media (max-width: 575.98px) {
  .login-form-panel {
    padding: 1.25rem;
  }

  .login-form-container {
    padding: 1.5rem;
    border-radius: 14px;
  }

  .login-heading h1 {
    font-size: 1.375rem;
  }

  .login-secondary-actions {
    flex-direction: column;
  }

  .login-footer {
    margin-top: 1.5rem;
  }
}

@media (max-width: 374.98px) {
  .login-form-container {
    padding: 1.25rem;
  }
}

/* ============ ANIMATION ============ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-form-container {
  animation: fadeInUp 0.4s ease-out;
}

.brand-content {
  animation: fadeInUp 0.5s ease-out 0.1s both;
}
