/* ==========================================================
   SALES CALL MANAGEMENT SYSTEM — Shared Auth CSS
   Used by: login, forgot_password, reset_password, org_select
   Page-specific overrides (bg gradient, orb colors) stay inline.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Dot grid overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

/* Floating orbs — colors set per-page inline */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
  animation: drift 12s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.08); }
}

/* Wrap */
.login-wrap {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

/* Brand area */
.brand-area {
  text-align: center;
  margin-bottom: 28px;
}
.brand-area img {
  max-height: 90px;
  max-width: 260px;
  object-fit: contain;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,.4));
  border-radius: 12px;
}
.brand-area .brand-text {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
}
.brand-area .tagline {
  font-size: .8rem;
  color: rgba(255,255,255,.45);
  margin-top: 5px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* Glass card */
.card {
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: 36px 40px;
  box-shadow: 0 24px 60px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.1);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.card-subtitle {
  font-size: .85rem;
  color: rgba(255,255,255,.45);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Alerts */
.alert {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .85rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}
.alert-danger  { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.15);  border: 1px solid rgba(34,197,94,.3);  color: #86efac; }

/* Form */
.form-group { margin-bottom: 18px; }
label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  margin-bottom: 6px;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.input-wrap { position: relative; }
.input-wrap .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.3);
  font-size: .9rem;
  pointer-events: none;
}
input[type=email],
input[type=password],
input[type=text],
input[type=number] {
  width: 100%;
  padding: 13px 16px 13px 42px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  color: #fff;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: .95rem;
  transition: border-color .2s, background .2s, box-shadow .2s;
  outline: none;
}
input[type=email]:focus,
input[type=password]:focus,
input[type=text]:focus,
input[type=number]:focus {
  border-color: rgba(242,101,34,.8);
  background: rgba(255,255,255,.09);
  box-shadow: 0 0 0 3px rgba(242,101,34,.2);
}
input::placeholder { color: rgba(255,255,255,.25); }

/* OTP input variant (reset_password) */
input.otp-input {
  text-align: center;
  padding-left: 16px;
  font-size: 1.6rem;
  letter-spacing: 12px;
  font-family: 'Courier New', monospace;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,.35);
  cursor: pointer;
  padding: 2px;
  font-size: .9rem;
  transition: color .2s;
}
.password-toggle:hover { color: rgba(255,255,255,.7); }

/* Submit button */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #f26522 0%, #d4571a 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .3px;
  transition: background .25s, transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(242,101,34,.4);
  margin-top: 6px;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #d4571a 0%, #b84a15 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(242,101,34,.5);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary i { margin-right: 8px; }

/* Footer links */
.card-footer {
  text-align: center;
  margin-top: 24px;
  font-size: .82rem;
  color: rgba(255,255,255,.35);
}
.card-footer a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color .2s;
}
.card-footer a:hover { color: #f26522; }

/* Divider */
.divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,.08);
  margin: 20px 0;
}

/* Org select card variants */
.org-list { list-style: none; padding: 0; margin: 0; }
.org-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
  background: rgba(255,255,255,.04);
}
.org-item:hover {
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.2);
  transform: translateX(3px);
}
.org-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a2e5a, #0d1a36);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}
.org-name { font-weight: 600; color: #fff; font-size: .93rem; }
.org-slug { font-size: .78rem; color: rgba(255,255,255,.4); margin-top: 2px; }

/* Card icon (forgot password) */
.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(242,101,34,.2);
  border: 1px solid rgba(242,101,34,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.4rem;
  color: #f9a87d;
}

/* Small phones — keep content scrollable, tighten padding */
@media (max-width: 480px) {
  body { align-items: flex-start; padding: 20px 0; }
  .card { padding: 28px 22px; border-radius: 16px; }
  .login-wrap { padding: 16px; }
  .brand-area { margin-bottom: 20px; }
  .card-subtitle { margin-bottom: 20px; }
}

/* Very small phones (360px and below) */
@media (max-width: 360px) {
  .card { padding: 24px 16px; }
  .login-wrap { padding: 12px; }
  .card-title { font-size: 1.1rem; }
  .brand-area .brand-text { font-size: 1.35rem; }
  input[type=email],
  input[type=password],
  input[type=text],
  input[type=number] { font-size: .88rem; padding: 11px 14px 11px 38px; }
  .btn-primary { padding: 12px; font-size: .9rem; }
  input.otp-input { font-size: 1.3rem; letter-spacing: 8px; }
}
