:root {
  --green-deep:   #0F1E0A;
  --green-dark:   #1B3210;
  --green-mid:    #2A4D1A;
  --green-light:  #3D6B28;
  --gold:         #C8A84B;
  --gold-light:   #E8C96A;
  --gold-pale:    #F5E6A3;
  --cream:        #F7F0DC;
  --error:        #E05555;
  --success:      #4CAF7C;
  --warning:      #E8A020;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Crimson Pro', 'Noto Sans Bengali', serif;
  background: var(--green-deep);
  color: var(--cream);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  width: 100%;
}

/* ─── LEFT PANEL ─── */
.panel-left {
  background: linear-gradient(150deg, #0D1E08 0%, #1B3210 50%, #0A1606 100%);
  display: flex;
  flex-direction: column;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.panel-left::before {
  content: '';
  position: absolute;
  top: -100px; left: -100px;
  width: 500px; height: 500px;
  border-radius: 50%;
  border: 1px solid rgba(200, 168, 75, 0.06);
  box-shadow: 0 0 0 80px rgba(200, 168, 75, 0.03), 0 0 0 160px rgba(200, 168, 75, 0.015);
}

.panel-left::after {
  content: '';
  position: absolute;
  bottom: -100px; right: -100px;
  width: 400px; height: 400px;
  border-radius: 50%;
  border: 1px solid rgba(200, 168, 75, 0.06);
}

.left-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.back-link {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem; letter-spacing: 2px;
  color: rgba(200, 168, 75, 0.6);
  text-transform: uppercase;
  transition: color 0.2s;
}

.back-link:hover { color: var(--gold); }

.lang-toggle {
  display: flex;
  border: 1px solid rgba(200, 168, 75, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.lang-btn {
  padding: 4px 12px;
  background: transparent;
  border: none;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--gold);
  color: var(--green-deep);
  font-weight: 600;
}

.left-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.seal-container {
  width: 110px; height: 110px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(61, 107, 40, 0.3), transparent);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.seal-container::before {
  content: '';
  position: absolute; inset: 6px;
  border: 1px dashed rgba(200, 168, 75, 0.35);
  border-radius: 50%;
}

.seal-container img {
  width: 80px; height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(200, 168, 75, 0.3));
  position: relative;
  z-index: 1;
}

.brand-title {
  font-family: 'Cinzel', serif;
  font-size: 2.4rem; font-weight: 700;
  color: var(--gold);
  letter-spacing: 6px;
  margin-bottom: 6px;
}

.brand-sub {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem; letter-spacing: 3px;
  color: rgba(200, 168, 75, 0.5);
  text-transform: uppercase;
  margin-bottom: 32px;
}

.brand-desc {
  font-size: 1rem;
  color: rgba(247, 240, 220, 0.6);
  line-height: 1.7;
  max-width: 380px;
}

.info-cards {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: rgba(27, 50, 16, 0.5);
  border: 1px solid rgba(200, 168, 75, 0.12);
  border-left: 3px solid rgba(200, 168, 75, 0.4);
}

.info-card-icon { font-size: 1.2rem; flex-shrink: 0; }

.info-card-text {
  font-size: 0.85rem;
  color: rgba(247, 240, 220, 0.65);
}

.left-bottom {
  position: relative; z-index: 2;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem; letter-spacing: 2px;
  color: rgba(200, 168, 75, 0.3);
  text-align: center;
}

/* ─── RIGHT PANEL ─── */
.panel-right {
  background: var(--green-deep);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 64px;
  position: relative;
}

.panel-right::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(27, 50, 16, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

/* ─── TABS ─── */
.auth-tabs {
  display: flex;
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(200, 168, 75, 0.15);
  position: relative; z-index: 1;
}

.tab-btn {
  flex: 1;
  padding: 14px 20px;
  background: none; border: none;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem; letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(247, 240, 220, 0.35);
  cursor: pointer;
  transition: all 0.25s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-btn:hover:not(.active) { color: rgba(247, 240, 220, 0.6); }

/* ─── FORM PANELS ─── */
.form-wrapper { position: relative; z-index: 1; }
.form-panel { display: none; }
.form-panel.active { display: block; animation: fadeIn 0.3s ease; }

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

.form-header { margin-bottom: 32px; }

.form-title {
  font-family: 'Cinzel', serif;
  font-size: 1.7rem; font-weight: 600;
  color: var(--cream);
  line-height: 1.2;
}

.form-subtitle {
  margin-top: 8px;
  font-size: 0.9rem;
  color: rgba(247, 240, 220, 0.5);
}

/* ─── FIELDS ─── */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-group { margin-bottom: 20px; }

label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem; letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(200, 168, 75, 0.7);
  margin-bottom: 8px;
}

input, select {
  width: 100%;
  padding: 13px 16px;
  background: rgba(27, 50, 16, 0.4);
  border: 1px solid rgba(200, 168, 75, 0.2);
  border-radius: 2px;
  color: var(--cream);
  font-family: 'Crimson Pro', 'Noto Sans Bengali', serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
}

input::placeholder { color: rgba(247, 240, 220, 0.25); }
input:focus, select:focus {
  border-color: var(--gold);
  background: rgba(27, 50, 16, 0.6);
}

input.error { border-color: var(--error); }
select option { background: var(--green-dark); }

.field-hint {
  font-size: 0.75rem;
  color: rgba(247, 240, 220, 0.3);
  margin-top: 5px;
}

.field-error {
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 5px;
  display: none;
}

.field-error.show { display: block; }

.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 44px; }

.toggle-pass {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: rgba(200, 168, 75, 0.5);
  cursor: pointer; font-size: 1rem; padding: 0;
  transition: color 0.2s;
}

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

/* ─── ROLE SELECTOR ─── */
.role-selector-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem; letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(200, 168, 75, 0.7);
  margin-bottom: 8px;
}

.role-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.role-option { display: none; }

.role-label {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(200, 168, 75, 0.15);
  background: rgba(27, 50, 16, 0.3);
  cursor: pointer; border-radius: 2px;
  transition: all 0.2s;
  position: relative;
}

.role-label:hover {
  border-color: rgba(200, 168, 75, 0.35);
  background: rgba(27, 50, 16, 0.5);
}

.role-option:checked + .role-label {
  border-color: var(--gold);
  background: rgba(200, 168, 75, 0.08);
}

.role-icon { font-size: 1.3rem; }

.role-text .r-name {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem; letter-spacing: 1px;
  color: var(--cream);
}

.role-text .r-sub {
  font-size: 0.65rem;
  color: rgba(200, 168, 75, 0.5);
  margin-top: 1px;
  display: block;
}

.role-restricted-badge {
  position: absolute;
  top: 5px; right: 6px;
  font-size: 0.5rem; letter-spacing: 1px;
  background: rgba(232, 160, 32, 0.15);
  border: 1px solid rgba(232, 160, 32, 0.4);
  color: var(--warning);
  padding: 2px 5px;
  border-radius: 2px;
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
}

/* ─── SUBMIT BUTTON ─── */
.btn-submit {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: none; border-radius: 2px;
  color: var(--green-deep);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 8px;
  position: relative; overflow: hidden;
}

.btn-submit:hover {
  box-shadow: 0 4px 24px rgba(200, 168, 75, 0.3);
  transform: translateY(-1px);
}

.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-submit .spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(15, 30, 10, 0.3);
  border-top-color: var(--green-deep);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading .spinner { display: block; }

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

.or-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 20px 0;
}

.or-line { flex: 1; height: 1px; background: rgba(200, 168, 75, 0.12); }

.or-text {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem; letter-spacing: 2px;
  color: rgba(200, 168, 75, 0.3);
  text-transform: uppercase;
}

.switch-text {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: rgba(247, 240, 220, 0.45);
}

.switch-link {
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.switch-link:hover { color: var(--gold-light); }

/* ─── ROLE REQUEST PENDING SCREEN ─── */
.pending-screen {
  display: none;
  text-align: center;
  padding: 20px 0;
  animation: fadeIn 0.4s ease;
}

.pending-screen.active { display: block; }

.pending-icon { font-size: 3.5rem; margin-bottom: 20px; }

.pending-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: var(--warning);
  margin-bottom: 12px;
}

.pending-msg {
  font-size: 0.95rem;
  color: rgba(247, 240, 220, 0.6);
  line-height: 1.7;
  max-width: 360px;
  margin: 0 auto 24px;
}

.pending-role-badge {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid rgba(232, 160, 32, 0.4);
  background: rgba(232, 160, 32, 0.08);
  color: var(--warning);
  font-family: 'Cinzel', serif;
  font-size: 0.7rem; letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 2px;
  margin-bottom: 24px;
}

.pending-info {
  padding: 16px 20px;
  background: rgba(27, 50, 16, 0.5);
  border: 1px solid rgba(200, 168, 75, 0.12);
  border-left: 3px solid rgba(200, 168, 75, 0.4);
  text-align: left;
  margin-bottom: 24px;
}

.pending-info p {
  font-size: 0.85rem;
  color: rgba(247, 240, 220, 0.55);
  line-height: 1.6;
}

.pending-login-btn {
  padding: 12px 30px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--green-deep);
  font-family: 'Cinzel', serif;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  border: none; border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.pending-login-btn:hover { box-shadow: 0 4px 20px rgba(200, 168, 75, 0.3); }

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 32px; right: 32px;
  padding: 16px 24px;
  background: var(--green-dark);
  border: 1px solid rgba(200, 168, 75, 0.25);
  border-left: 4px solid var(--gold);
  color: var(--cream);
  font-size: 0.9rem;
  max-width: 360px;
  z-index: 9999;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

.toast.show { transform: translateX(0); }
.toast.error-toast   { border-left-color: var(--error); }
.toast.success-toast { border-left-color: var(--success); }
.toast.warning-toast { border-left-color: var(--warning); }

.toast-title {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem; letter-spacing: 1px;
  margin-bottom: 4px;
}

.toast-msg {
  font-size: 0.88rem;
  color: rgba(247, 240, 220, 0.7);
}

/* ─── SUCCESS OVERLAY ─── */
.success-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10, 20, 6, 0.95);
  z-index: 9998;
  align-items: center; justify-content: center;
  flex-direction: column;
  text-align: center; padding: 40px;
}

.success-overlay.show { display: flex; animation: fadeIn 0.4s ease; }
.success-icon { font-size: 4rem; margin-bottom: 20px; }

.success-title {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 12px;
}

.success-msg {
  font-size: 1rem;
  color: rgba(247, 240, 220, 0.6);
  margin-bottom: 32px;
  max-width: 420px;
  line-height: 1.7;
}

.success-btn {
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--green-deep);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  border: none; border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.success-btn:hover { box-shadow: 0 4px 20px rgba(200, 168, 75, 0.3); }

/* ─── LANGUAGE HELPERS ─── */
.bn-inline { display: none; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .panel-left { display: none; }
  .panel-right { padding: 40px 24px; justify-content: flex-start; padding-top: 80px; }
}