/**
 * EngineerHindi Web Auth & Login System
 * Styles for Shortcode Buttons, User Dropdown, and Modal
 */

:root {
  --eh-brand: #881337;
  --eh-brand-hover: #9f1239;
  --eh-brand-light: rgba(136, 19, 55, 0.08);
  --eh-gold: #d97706;
  --eh-slate-900: #0f172a;
  --eh-slate-800: #1e293b;
  --eh-slate-700: #334155;
  --eh-slate-600: #475569;
  --eh-slate-200: #e2e8f0;
  --eh-slate-100: #f1f5f9;
}

/* ========================================================
   1. SHORTCODE LOGIN BUTTONS & USER PILL
======================================================== */
.eh-auth-widget {
  display: inline-block;
  position: relative;
  font-family: 'Mukta', system-ui, -apple-system, sans-serif;
  vertical-align: middle;
}

/* Login Trigger Button */
.eh-login-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--eh-brand);
  color: #ffffff !important;
  border: none;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(136, 19, 55, 0.25);
  transition: all 0.2s ease;
  text-decoration: none !important;
  line-height: 1.2;
}

.eh-login-trigger-btn:hover {
  background: var(--eh-brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(136, 19, 55, 0.35);
}

.eh-login-trigger-btn.compact {
  padding: 6px 12px;
  font-size: 13px;
}

.eh-login-trigger-btn.outline {
  background: transparent;
  color: var(--eh-brand) !important;
  border: 1.5px solid var(--eh-brand);
  box-shadow: none;
}

.eh-login-trigger-btn.outline:hover {
  background: var(--eh-brand-light);
}

/* User Logged-in Pill */
.eh-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--eh-slate-100);
  border: 1.5px solid var(--eh-slate-200);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--eh-slate-800);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.eh-user-pill:hover {
  background: #ffffff;
  border-color: var(--eh-brand);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.eh-user-avatar-badge {
  width: 22px;
  height: 22px;
  background: var(--eh-brand);
  color: #ffffff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.eh-user-dropdown-caret {
  font-size: 10px;
  color: var(--eh-slate-500);
  transition: transform 0.2s;
}

.eh-user-logged-in.open .eh-user-dropdown-caret {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.eh-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid var(--eh-slate-200);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 8px 0;
  z-index: 99999;
  text-align: left;
  animation: eh-drop-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.eh-user-logged-in.open .eh-user-dropdown {
  display: block;
}

@keyframes eh-drop-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.eh-dropdown-user-info {
  padding: 10px 16px;
  border-bottom: 1px solid var(--eh-slate-200);
}

.eh-dropdown-user-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--eh-slate-900);
  display: block;
}

.eh-dropdown-user-phone {
  font-size: 12px;
  color: var(--eh-slate-500);
  font-weight: 500;
}

.eh-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--eh-slate-700) !important;
  text-decoration: none !important;
  transition: background 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  box-sizing: border-box;
}

.eh-dropdown-item:hover {
  background: var(--eh-slate-100);
  color: var(--eh-brand) !important;
}

.eh-dropdown-item.logout {
  color: #dc2626 !important;
  border-top: 1px dashed var(--eh-slate-200);
  margin-top: 4px;
}

.eh-dropdown-item.logout:hover {
  background: #fef2f2;
}

/* ========================================================
   2. GLOBAL LOGIN MODAL
======================================================== */
.eh-login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  font-family: 'Mukta', system-ui, -apple-system, sans-serif;
}

.eh-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}

.eh-modal-box {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 360px;
  padding: 28px 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  animation: eh-modal-in 0.25s ease-out;
  box-sizing: border-box;
}

@keyframes eh-modal-in {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.eh-modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--eh-slate-100);
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--eh-slate-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.eh-modal-close-btn:hover {
  background: var(--eh-slate-200);
  color: var(--eh-slate-900);
}

/* Modal Header */
.eh-modal-header {
  text-align: center;
  margin-bottom: 22px;
}

.eh-modal-icon-badge {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--eh-brand) 0%, #4c0519 100%);
  color: #ffffff;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(136, 19, 55, 0.3);
}

.eh-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--eh-slate-900);
  margin: 0 0 4px 0;
}

.eh-modal-subtitle {
  font-size: 13px;
  color: var(--eh-slate-500);
  margin: 0;
}

/* Form Groups & Inputs */
.eh-form-group {
  margin-bottom: 18px;
  text-align: left;
}

.eh-form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--eh-slate-700);
  margin-bottom: 6px;
}

.eh-phone-input-wrap {
  display: flex;
  align-items: center;
  border: 2px solid var(--eh-slate-200);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  transition: border-color 0.2s;
}

.eh-phone-input-wrap:focus-within {
  border-color: var(--eh-brand);
}

.eh-country-code {
  padding: 10px 12px;
  background: var(--eh-slate-100);
  font-size: 15px;
  font-weight: 700;
  color: var(--eh-slate-700);
  border-right: 1px solid var(--eh-slate-200);
}

.eh-input-field {
  width: 100%;
  border: none;
  outline: none;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--eh-slate-900);
  box-sizing: border-box;
}

.eh-input-field-standalone {
  width: 100%;
  border: 2px solid var(--eh-slate-200);
  border-radius: 12px;
  outline: none;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--eh-slate-900);
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.eh-input-field-standalone:focus {
  border-color: var(--eh-brand);
}

.eh-otp-input {
  letter-spacing: 12px;
  font-size: 22px;
  text-align: center;
  font-weight: 800;
  padding-left: 20px;
}

/* Modal Buttons */
.eh-modal-btn {
  width: 100%;
  background: var(--eh-brand);
  color: #ffffff;
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(136, 19, 55, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.eh-modal-btn:hover {
  background: var(--eh-brand-hover);
  transform: translateY(-1px);
}

.eh-modal-footer-text {
  text-align: center;
  font-size: 12px;
  color: var(--eh-slate-400);
  margin-top: 14px;
  line-height: 1.4;
}

/* OTP Info & Resend */
.eh-otp-info {
  background: var(--eh-brand-light);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--eh-brand);
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eh-link-btn {
  background: none;
  border: none;
  color: var(--eh-brand);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.eh-resend-box {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--eh-slate-500);
}

.eh-resend-btn {
  background: none;
  border: none;
  color: var(--eh-brand);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
}

.eh-resend-btn:disabled {
  color: var(--eh-slate-400);
  cursor: not-allowed;
}

/* Alerts & Loading */
.eh-auth-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  display: none;
}

.eh-auth-alert.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  display: block;
}

.eh-auth-alert.success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  display: block;
}

.eh-auth-alert.info {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  display: block;
}

.eh-auth-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.eh-auth-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--eh-slate-200);
  border-top-color: var(--eh-brand);
  border-radius: 50%;
  animation: eh-spin 0.8s linear infinite;
  margin-bottom: 10px;
}

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