:root {
  --primary: #6f4426;
  --primary-hover: #5b371f;
  --primary-soft: #f6efe9;
  --brown-dark: #2a160b;
  --brown-panel: #3b2415;
  --cream: #faf7f2;
  --white: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: #f8fafc;
}

.login-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 41.2% 58.8%;
}

.login-brand-panel {
  position: relative;
  overflow: hidden;
  padding: 58px 78px;
  color: var(--white);
  background:
    radial-gradient(circle at 98% -8%, rgba(255, 255, 255, .08) 0 18%, transparent 19%),
    radial-gradient(circle at 95% 105%, rgba(255, 255, 255, .06) 0 15%, transparent 16%),
    linear-gradient(145deg, var(--brown-panel), var(--brown-dark));
}

.login-brand-panel::before,
.login-brand-panel::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .05);
  pointer-events: none;
}

.login-brand-panel::before {
  width: 420px;
  height: 420px;
  top: -220px;
  right: -100px;
}

.login-brand-panel::after {
  width: 540px;
  height: 540px;
  right: -275px;
  bottom: -285px;
}

.brand-content {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 116px);
  display: flex;
  flex-direction: column;
}

.brand-logo-wrap {
  display: flex;
  gap: 18px;
  align-items: center;
}

.brand-logo {
  width: 118px;
  height: 118px;
  object-fit: contain;
}

.brand-logo-wrap h1 {
  margin: 0 0 8px;
  font-size: 29px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.brand-logo-wrap p,
.brand-hero p,
.feature-item p,
.security-box p,
.copyright {
  margin: 0;
  color: rgba(255, 255, 255, .88);
}

.brand-logo-wrap p {
  max-width: 330px;
  font-size: 15px;
  line-height: 1.55;
}

.brand-hero {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}

.brand-hero h2 {
  max-width: 500px;
  margin: 0 0 18px;
  font-size: 38px;
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -.03em;
}

.brand-hero h2 span {
  display: block;
  color: #e7b07a;
}

.brand-hero p {
  max-width: 520px;
  font-size: 17px;
  line-height: 1.75;
}

.feature-list {
  display: grid;
  gap: 28px;
  margin-top: 36px;
}

.feature-item {
  display: flex;
  gap: 18px;
  align-items: center;
}

.feature-icon,
.security-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--white);
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.feature-icon i,
.security-icon i {
  font-size: 29px;
}

.feature-item h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
}

.feature-item p {
  font-size: 15px;
  line-height: 1.45;
}

.security-box {
  max-width: 438px;
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: auto;
  margin-bottom: 78px;
  padding: 22px 20px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .08);
}

.security-box p {
  font-size: 15px;
  line-height: 1.65;
}

.copyright {
  margin-top: auto;
  padding-top: 42px;
  font-size: 14px;
}

.login-form-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px;
  background: radial-gradient(circle at center, #ffffff 0, #ffffff 44%, #f7f7f7 100%);
}

.login-card {
  width: min(100%, 690px);
  padding: 48px 50px 54px;
  border: 1px solid rgba(17, 24, 39, .06);
  border-radius: 10px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
}

.login-logo-mini {
  text-align: center;
  margin-bottom: 18px;
}

.login-logo-mini img {
  width: 90px;
  height: 90px;
  object-fit: contain;
}

.login-title h2 {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -.03em;
}

.login-title p {
  margin: 0;
  color: #363b44;
  font-size: 15px;
}

.login-form {
  margin-top: 42px;
}

.form-group-custom {
  margin-bottom: 24px;
}

.form-group-custom label {
  display: block;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 800;
}

.input-group-custom {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border: 1px solid #d7dce2;
  border-radius: 8px;
  background: var(--white);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.input-group-custom:focus-within {
  border-color: rgba(111, 68, 38, .65);
  box-shadow: 0 0 0 .25rem rgba(111, 68, 38, .12);
}

.input-group-custom i {
  color: #60646c;
  font-size: 20px;
}

.input-group-custom input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text-primary);
  font-size: 15px;
  background: transparent;
}

.input-group-custom input::placeholder {
  color: #70747d;
}

.toggle-password {
  border: 0;
  padding: 0;
  color: #5d6169;
  background: transparent;
}

.error-text {
  display: none;
  margin-top: 8px;
  color: var(--danger);
  font-weight: 600;
}

.form-group-custom.is-invalid .input-group-custom {
  border-color: var(--danger);
}

.form-group-custom.is-invalid .error-text {
  display: block;
}

.form-options {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: -2px 0 28px;
  font-size: 14px;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.forgot-link,
.admin-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.forgot-link:hover,
.admin-link:hover {
  color: var(--primary-hover);
}

.btn-login,
.btn-login-secondary {
  width: 100%;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
}

.btn-login {
  border: 0;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary), #5c3419);
  box-shadow: 0 10px 22px rgba(111, 68, 38, .2);
}

.btn-login:hover,
.btn-login:focus {
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-hover), #452511);
}

.btn-login-secondary {
  border: 1px solid rgba(111, 68, 38, .35);
  color: var(--primary);
  background: var(--white);
  text-decoration: none;
}

.btn-login-secondary:hover {
  color: var(--primary-hover);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.btn-loader {
  display: none;
  width: 19px;
  height: 19px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: var(--white);
  border-radius: 50%;
}

.btn-login.loading .btn-loader {
  display: inline-block;
  animation: spin .8s linear infinite;
}

.btn-login.loading .btn-text {
  opacity: .85;
}

.divider {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 32px 0;
  color: #5f646e;
  font-size: 14px;
}

.divider::before,
.divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--border);
}

.login-footer-text {
  margin: 34px 0 0;
  color: #4b5563;
  font-size: 15px;
}

.animate-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp .8s ease forwards;
}

.animate-scale {
  opacity: 0;
  transform: scale(.96) translateY(18px);
  animation: scaleIn .75s ease forwards;
}

.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .22s; }
.delay-3 { animation-delay: .32s; }

.shake { animation: shake .38s ease; }

@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

@media (max-width: 1200px) {
  .login-wrapper { grid-template-columns: 45% 55%; }
  .login-brand-panel { padding: 48px; }
  .brand-hero h2 { font-size: 34px; }
  .login-form-panel { padding: 48px; }
}

@media (max-width: 992px) {
  .login-wrapper { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { padding: 40px 22px; }
  .login-card { padding: 42px 28px; }
  .login-title h2 { font-size: 28px; }
}

@media (max-width: 576px) {
  .login-card { padding: 34px 22px; border-radius: 18px; }
  .form-options { align-items: flex-start; flex-direction: column; }
  .input-group-custom,
  .btn-login,
  .btn-login-secondary { height: 56px; }
}
