/* ════════════════════════════════════════════════════════
   KRS INFOTECH CRM — Login Page (Light Theme)
   ════════════════════════════════════════════════════════ */

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

/* ── Root Variables ── */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.10);
  --primary-soft: rgba(79, 70, 229, 0.06);
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

  --white: #ffffff;
  --bg-body: #f0f4f8;
  --border: #e2e8f0;
  --text-dark: #0f172a;
  --text-mid: #475569;
  --text-muted: #94a3b8;
  --text-light: #f1f5f9;
  --radius: 10px;
  --radius-lg: 16px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 25px 60px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  -webkit-font-smoothing: antialiased;
}

/* ── Outer Wrapper ── */
.page-wrapper {
  display: flex;
  width: 100%;
  max-width: 960px;
  min-height: 600px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--white);
}

/* ══════════════════════════════════════════════
   LEFT PANEL — Light Gradient Brand
══════════════════════════════════════════════ */

.left-panel {
  flex: 0 0 44%;
  background: linear-gradient(160deg, #eef2ff 0%, #e0e7ff 40%, #c7d2fe 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  padding: 2.5rem 2.2rem;
}

/* Decorative background shapes */
.bg-circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.bg-circle-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.10) 0%, transparent 65%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.bg-circle-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.07) 0%, transparent 60%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.bg-circle-3 {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
  top: 5%;
  right: -40px;
}

.left-inner {
  position: relative;
  z-index: 1;
  width: 100%;
}

/* Brand */
.brand-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: var(--primary-gradient);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
  flex-shrink: 0;
}

.brand-logo-sm {
  width: 36px;
  height: 36px;
  background: var(--primary-gradient);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.brand-tagline {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Headline */
.left-headline {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 0.75rem;
}

.headline-accent {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.left-desc {
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 320px;
}

/* Feature List */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.feature-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.feat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.feat-indigo {
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
}

.feat-title {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.feat-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ══════════════════════════════════════════════
   RIGHT PANEL — White Login Form
══════════════════════════════════════════════ */

.right-panel {
  flex: 1;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 3rem;
}

.form-area {
  width: 100%;
  max-width: 370px;
}

/* Tab Bar */
.tab-bar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
}

.tab-pill {
  border: 1px solid var(--border);
  background: var(--bg-body);
  color: var(--text-mid);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0.45rem 0.85rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.tab-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.35);
}

/* Form Heading */
.form-heading {
  margin-bottom: 1.5rem;
}

.form-heading h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.3px;
  margin-bottom: 0.3rem;
}

.form-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.primary-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--transition);
}

.primary-link:hover {
  opacity: 0.78;
  color: var(--primary-hover);
}

/* ── Field Group ── */
.field-group {
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-mid);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.label-icon {
  color: var(--text-muted);
  margin-right: 2px;
}

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

.field-ico {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  transition: color var(--transition);
}

.field-input {
  width: 100%;
  padding: 0.7rem 2.8rem 0.7rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--white);
  outline: none;
  transition: all var(--transition);
}

.field-input::placeholder {
  color: #cbd5e1;
  font-weight: 400;
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.field-wrap:focus-within .field-ico {
  color: var(--primary);
}

/* Eye toggle */
.eye-btn {
  position: absolute;
  right: 0.85rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  transition: color var(--transition);
}

.eye-btn:hover {
  color: var(--primary);
}

/* Validation */
.field-input.has-error {
  border-color: var(--danger);
  background: #fef2f2;
}

.field-input.has-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.field-error {
  display: block;
  font-size: 0.73rem;
  color: var(--danger);
  margin-top: 0.3rem;
  min-height: 16px;
}

/* ── Remember Row ── */
.remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.remember-chk {
  display: none;
}

.chk-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.remember-chk:checked+.chk-box {
  background: var(--primary);
  border-color: var(--primary);
}

.remember-chk:checked+.chk-box::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

.chk-text {
  font-size: 0.8rem;
  color: var(--text-mid);
  font-weight: 500;
}

.forgot-link {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition);
}

.forgot-link:hover {
  opacity: 0.75;
  color: var(--primary);
}

/* ── Login Button ── */
.login-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.30);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.login-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, transparent 100%);
}

.login-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.40);
}

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

.login-btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

/* Spinner */
.spin-ring {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* ── Sign-Up Section ── */
.signup-section {
  text-align: center;
  margin-bottom: 1.5rem;
}

.signup-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.create-account-link {
  font-size: 0.83rem;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  transition: opacity var(--transition);
}

.create-account-link:hover {
  opacity: 0.78;
  color: var(--primary);
}

/* ── Footer ── */
.form-footer {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */

@media (max-width: 991.98px) {
  .page-wrapper {
    flex-direction: column;
    max-width: 480px;
    min-height: auto;
  }

  .left-panel {
    display: none !important;
  }

  .right-panel {
    padding: 2rem 1.75rem;
  }

  .form-area {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0;
    align-items: stretch;
  }

  .page-wrapper {
    border-radius: 0;
    min-height: 100vh;
    box-shadow: none;
  }

  .right-panel {
    padding: 1.75rem 1.25rem;
  }

  .form-heading h2 {
    font-size: 1.35rem;
  }

  .tab-pill {
    font-size: 0.72rem;
    padding: 0.4rem 0.65rem;
  }
}
