:root { color-scheme: light; }
/* ── Base reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, sans-serif;
  background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 100%);
  min-height: 100vh;
}

/* ── Root container ─────────────────────────────────────────────── */
.login-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: 1.5rem;
}

/* ── Loading spinner ────────────────────────────────────────────── */
.portal-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #d1d9ff;
  border-top-color: #4f6ef7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Login card ─────────────────────────────────────────────────── */
.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(79, 110, 247, 0.12), 0 2px 8px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ── Brand header ───────────────────────────────────────────────── */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}

.login-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.login-institute-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1f36;
  letter-spacing: -0.4px;
}

.login-tagline {
  font-size: 0.9rem;
  color: #6b7280;
}

/* ── Form ───────────────────────────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.login-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.02em;
}

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

.login-input {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.97rem;
  color: #1a1f36;
  background: #f9fafb;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.login-input:focus {
  border-color: #4f6ef7;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}

.login-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* password field — make room for the eye button */
.login-input-wrap .login-input {
  padding-right: 2.8rem;
}

.login-eye {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  color: #9ca3af;
  transition: color 0.15s;
}

.login-eye:hover { color: #4f6ef7; }

.login-eye svg {
  width: 18px;
  height: 18px;
}

/* ── Error banner ───────────────────────────────────────────────── */
.login-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.87rem;
  color: #be123c;
  line-height: 1.4;
}

.login-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: #be123c;
}

/* ── Submit button ──────────────────────────────────────────────── */
.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f6ef7 0%, #7c3aed 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.15s;
  margin-top: 0.25rem;
}

.login-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
}

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

.login-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* inline spinner inside the button */
.login-btn-spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── Footer note inside card ────────────────────────────────────── */
.login-footer-note {
  font-size: 0.78rem;
  color: #9ca3af;
  text-align: center;
  line-height: 1.5;
}

/* ── Page footer ────────────────────────────────────────────────── */
.portal-footer {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-card {
    padding: 2rem 1.4rem;
    border-radius: 18px;
  }

  .login-institute-name { font-size: 1.35rem; }
}

/* ── Landing option buttons ─────────────────────────────────────── */
.login-options {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.login-option-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.2rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.login-option-btn:hover {
  border-color: #4f6ef7;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.1);
}

.login-option-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4f6ef7 0%, #7c3aed 100%);
  border-radius: 10px;
  color: #fff;
}

.login-option-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.login-option-text strong {
  font-size: 0.97rem;
  font-weight: 600;
  color: #1a1f36;
}

.login-option-text small {
  font-size: 0.8rem;
  color: #6b7280;
}

/* ── Back button ────────────────────────────────────────────────── */
.login-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: #4f6ef7;
  padding: 0.2rem 0;
  transition: opacity 0.15s;
}

.login-back:hover { opacity: 0.75; }

/* ── Phone prefix ───────────────────────────────────────────────── */
.login-phone-prefix {
  position: absolute;
  left: 1rem;
  font-size: 0.97rem;
  color: #374151;
  font-weight: 500;
  pointer-events: none;
  user-select: none;
}

.login-input-phone {
  padding-left: 3.2rem !important;
}

/* ── OTP phone label ────────────────────────────────────────────── */
.otp-phone-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.otp-phone-number {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1a1f36;
}

.otp-phone-hint {
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
  line-height: 1.5;
}

/* ── Individual digit inputs (matches kinstitute) ───────────────── */
.otp-inputs-row {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-start;
  margin: 0.5rem 0;
}

.otp-digit-input {
  width: 56px;
  height: 56px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
  outline: none;
  background: #f9fafb;
  color: #1a1f36;
  transition: border-color 0.15s ease, background 0.15s;
  flex-shrink: 0;
}

.otp-digit-input:focus {
  background: #fff;
}

.otp-digit-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Resend row ─────────────────────────────────────────────────── */
.otp-resend-row {
  text-align: right;
  margin-bottom: 0.25rem;
}

.otp-resend-timer {
  font-size: 0.8rem;
  color: #6b7280;
}

/* ── Inline link-style button ───────────────────────────────────── */
.login-link-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #4f6ef7;
  font-size: inherit;
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.15s;
}

.login-link-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════
   Kinstitute-style two-column layout + form components
   ═══════════════════════════════════════════════════════════════════ */

/* ── Two-column layout ───────────────────────────────────────────── */
.kl-container {
  height: 100vh;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: row;
}

.kl-left {
  flex: 1;
  background: linear-gradient(135deg, #FF6B35 0%, #E91E63 50%, #9C27B0 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 50px 20px;
  position: relative;
  overflow: hidden;
}

.kl-illustration {
  width: 200px;
  height: auto;
  margin-bottom: 20px;
  z-index: 1;
}

.kl-left-text {
  max-width: 400px;
  z-index: 999;
  text-align: center;
}

.kl-heading {
  font-weight: bold;
  font-size: 30px;
  margin-bottom: 10px;
  line-height: 42px;
}

.kl-description {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
  opacity: 0.9;
}

.kl-bgline {
  width: 300px;
  height: auto;
  position: absolute;
  bottom: 0;
  left: 0;
  opacity: 0.6;
}

.kl-right {
  flex: 1;
  background: #fff;
  padding: 50px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
}

.kl-logo {
  width: 180px;
  height: auto;
  margin-bottom: 30px;
  object-fit: contain;
}

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

/* ── Form header ─────────────────────────────────────────────────── */
.ki-form-header {
  margin-bottom: 20px;
  text-align: left;
}

.ki-form-title {
  font-size: 18px;
  font-weight: bold;
  margin: 0;
  color: #1a1a1a;
}

.ki-form-subtitle {
  font-size: 14px;
  color: #666;
  margin: 5px 0 0 0;
}

/* ── Input wrapper ───────────────────────────────────────────────── */
.ki-input-wrapper {
  position: relative;
  margin-bottom: 20px;
  background: #f9f9f9;
  border-radius: 5px;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
}

.ki-input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.ki-input {
  width: 100%;
  padding: 12px 10px 12px 35px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: #1a1a1a;
  outline: none;
  font-size: 14px;
}

.ki-toggle-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #FF6B35;
  font-weight: 500;
  font-size: 13px;
  padding: 0;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.ki-btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #FF6B35 0%, #E91E63 50%, #9C27B0 100%);
  color: #fff;
  border-radius: 25px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.ki-btn-primary:hover:not(:disabled) { opacity: 0.9; }
.ki-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.ki-btn-secondary {
  margin-top: 8px;
  padding: 12px 30px;
  background: transparent;
  color: #FF6B35;
  width: 100%;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  border: 2px solid #FF6B35;
  font-weight: 600;
  transition: all 0.3s ease;
}

.ki-btn-secondary:hover { background: rgba(255, 107, 53, 0.06); }

/* ── Error ───────────────────────────────────────────────────────── */
.ki-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 13px;
  color: #be123c;
  margin-bottom: 12px;
}

/* ── Link / back text ────────────────────────────────────────────── */
.ki-link {
  margin-top: 12px;
  color: #666;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
}

.ki-link:hover { color: #FF6B35; }

/* ── OTP elements ────────────────────────────────────────────────── */
.ki-phone-number {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a1a;
}

.ki-otp-message {
  font-size: 14px;
  color: #666;
  margin-top: 6px;
  line-height: 1.5;
}

.ki-otp-container {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin: 18px 0 14px;
}

.ki-otp-input {
  width: 56px;
  height: 56px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  outline: none;
  transition: border-color 0.15s ease;
  background: #f9f9f9;
}

.ki-resend-container {
  text-align: right;
  margin-bottom: 18px;
}

.ki-resend-timer {
  color: #666;
  font-size: 12px;
}

.ki-resend-btn {
  background: none;
  border: none;
  color: #FF6B35;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  padding: 0;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .kl-left { display: none; }
  .kl-right { padding: 40px 24px; align-items: stretch; }
}
