/* ========================================================
   HAWIAH PLUS — auth.css | Premium Auth & Registration System
   ======================================================== */

/* ── Modal Overlay & Container ─────────────────────────── */
.hw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 15, 10, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hw-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.hw-modal-dialog {
  background: var(--bg2, #ffffff);
  color: var(--ink, #0a1f16);
  border: 1px solid var(--ln, rgba(0, 0, 0, 0.08));
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 208, 132, 0.15);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--green, #00d084) transparent;
}

[data-theme="dark"] .hw-modal-dialog {
  background: var(--bg2, #0d1e15);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(0, 208, 132, 0.25);
}

.hw-modal-overlay.active .hw-modal-dialog {
  transform: translateY(0) scale(1);
}

/* ── Modal Header ───────────────────────────────────────── */
.hw-modal-head {
  padding: 24px 28px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ln, rgba(0,0,0,0.06));
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.hw-modal-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hw-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,208,132,0.15), rgba(0,168,104,0.08));
  color: var(--green, #00d084);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(0,208,132,0.25);
}

.hw-modal-icon svg {
  width: 22px;
  height: 22px;
}

.hw-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink, #0a1f16);
  margin: 0;
}

.hw-modal-sub {
  font-size: 0.85rem;
  color: var(--ink3, #5a7a6e);
  margin-top: 3px;
}

.hw-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--ln, rgba(0,0,0,0.08));
  background: var(--g10, rgba(0,208,132,0.05));
  color: var(--ink3, #5a7a6e);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hw-modal-close:hover {
  background: #ff4d4f;
  color: #fff;
  border-color: #ff4d4f;
  transform: rotate(90deg);
}

.hw-modal-close svg {
  width: 18px;
  height: 18px;
}

/* ── Modal Body ─────────────────────────────────────────── */
.hw-modal-body {
  padding: 24px 28px 28px;
}

/* ── Main Mode Switcher (Login vs Register) ─────────────── */
.hw-auth-mode-switch {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--bg, #f5fdf9);
  border: 1px solid var(--ln, rgba(0,0,0,0.06));
  border-radius: 14px;
  margin-bottom: 22px;
}

[data-theme="dark"] .hw-auth-mode-switch {
  background: rgba(0,0,0,0.3);
}

.hw-auth-mode-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--ink3, #5a7a6e);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hw-auth-mode-btn svg {
  width: 16px;
  height: 16px;
}

.hw-auth-mode-btn.active {
  background: linear-gradient(135deg, var(--green, #00d084), var(--green-d, #00a868));
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,208,132,0.35);
}

/* ── Type Selector Cards (فرد | شركة | مزود خدمة) ───────── */
.hw-type-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .hw-type-cards {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.hw-type-card {
  padding: 14px 12px;
  border-radius: 14px;
  border: 2px solid var(--ln, rgba(0,0,0,0.08));
  background: var(--bg, #f5fdf9);
  cursor: pointer;
  text-align: center;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  user-select: none;
}

[data-theme="dark"] .hw-type-card {
  background: rgba(255,255,255,0.02);
}

.hw-type-card:hover {
  border-color: rgba(0,208,132,0.5);
  transform: translateY(-2px);
  background: rgba(0,208,132,0.04);
}

.hw-type-card.active {
  border-color: var(--green, #00d084);
  background: linear-gradient(135deg, rgba(0,208,132,0.12), rgba(0,168,104,0.04));
  box-shadow: 0 6px 20px rgba(0,208,132,0.18);
}

.hw-type-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--g10, rgba(0,208,132,0.1));
  color: var(--green, #00d084);
  transition: all 0.2s ease;
}

.hw-type-card.active .hw-type-icon {
  background: var(--green, #00d084);
  color: #fff;
}

.hw-type-icon svg {
  width: 20px;
  height: 20px;
}

.hw-type-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ink, #0a1f16);
  line-height: 1.2;
}

.hw-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  background: rgba(0,208,132,0.12);
  color: var(--green-d, #00a868);
}

[data-theme="dark"] .hw-type-badge {
  color: var(--green-l, #00e896);
}

/* ── Form Inputs & Layout ───────────────────────────────── */
.hw-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .hw-form-grid {
    grid-template-columns: 1fr;
  }
}

.hw-col-span-2 {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .hw-col-span-2 {
    grid-column: span 1;
  }
}

.hw-input-group {
  margin-bottom: 16px;
}

.hw-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink, #0a1f16);
  margin-bottom: 7px;
}

.hw-label .hw-req {
  color: #ff4d4f;
  margin-right: 3px;
}

.hw-label .hw-hint {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink4, #92aaa1);
}

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

.hw-field-icon {
  position: absolute;
  right: 14px;
  color: var(--ink4, #92aaa1);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

[dir="ltr"] .hw-field-icon {
  right: auto;
  left: 14px;
}

.hw-field-icon svg {
  width: 17px;
  height: 17px;
}

.hw-input,
.hw-select,
.hw-textarea {
  width: 100%;
  padding: 12px 42px 12px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--ink, #0a1f16);
  background: var(--bg, #f5fdf9);
  border: 1.5px solid var(--ln, rgba(0,0,0,0.1));
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
}

[dir="ltr"] .hw-input,
[dir="ltr"] .hw-select,
[dir="ltr"] .hw-textarea {
  padding: 12px 14px 12px 42px;
}

[data-theme="dark"] .hw-input,
[data-theme="dark"] .hw-select,
[data-theme="dark"] .hw-textarea {
  background: rgba(0,0,0,0.25);
  border-color: rgba(255,255,255,0.08);
}

.hw-input:focus,
.hw-select:focus,
.hw-textarea:focus {
  border-color: var(--green, #00d084);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0,208,132,0.15);
}

[data-theme="dark"] .hw-input:focus,
[data-theme="dark"] .hw-select:focus,
[data-theme="dark"] .hw-textarea:focus {
  background: #0d2218;
}

.hw-textarea {
  min-height: 80px;
  resize: vertical;
  padding-right: 14px;
}

.hw-input.error,
.hw-select.error {
  border-color: #ff4d4f;
  background: rgba(255,77,79,0.04);
}

.hw-error-msg {
  font-size: 0.78rem;
  color: #ff4d4f;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── File Upload Box ────────────────────────────────────── */
.hw-file-upload {
  position: relative;
  border: 1.5px dashed var(--ln, rgba(0,0,0,0.15));
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  background: var(--bg, #f5fdf9);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

[data-theme="dark"] .hw-file-upload {
  background: rgba(0,0,0,0.25);
  border-color: rgba(255,255,255,0.1);
}

.hw-file-upload:hover {
  border-color: var(--green, #00d084);
  background: rgba(0,208,132,0.03);
}

.hw-file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.hw-file-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--g10, rgba(0,208,132,0.1));
  color: var(--green, #00d084);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hw-file-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink, #0a1f16);
}

.hw-file-sub {
  font-size: 0.75rem;
  color: var(--ink4, #92aaa1);
}

.hw-file-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green-d, #00a868);
  display: none;
  margin-top: 4px;
}

/* ── Container Equipment Multi-Selector ─────────────────── */
.hw-equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.hw-equipment-item {
  padding: 10px;
  border-radius: 10px;
  border: 1.5px solid var(--ln, rgba(0,0,0,0.08));
  background: var(--bg, #f5fdf9);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

[data-theme="dark"] .hw-equipment-item {
  background: rgba(255,255,255,0.02);
}

.hw-equipment-item input[type="checkbox"] {
  accent-color: var(--green, #00d084);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.hw-equipment-item.selected {
  border-color: var(--green, #00d084);
  background: rgba(0,208,132,0.08);
  color: var(--green-d, #00a868);
  font-weight: 700;
}

[data-theme="dark"] .hw-equipment-item.selected {
  color: var(--green-l, #00e896);
}

/* ── Alert Notices (Pending Review & Info) ─────────────── */
.hw-alert-box {
  padding: 14px 16px;
  border-radius: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 0.86rem;
  line-height: 1.55;
}

.hw-alert-amber {
  background: rgba(250, 173, 20, 0.12);
  border: 1px solid rgba(250, 173, 20, 0.35);
  color: #ad6800;
}

[data-theme="dark"] .hw-alert-amber {
  background: rgba(250, 173, 20, 0.16);
  border-color: rgba(250, 173, 20, 0.4);
  color: #ffd666;
}

.hw-alert-green {
  background: rgba(0, 208, 132, 0.1);
  border: 1px solid rgba(0, 208, 132, 0.3);
  color: #007849;
}

[data-theme="dark"] .hw-alert-green {
  color: var(--green-l, #00e896);
}

.hw-alert-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.hw-alert-content strong {
  display: block;
  font-weight: 800;
  margin-bottom: 2px;
}

/* ── Buttons ────────────────────────────────────────────── */
.hw-submit-btn {
  width: 100%;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green, #00d084) 0%, var(--green-d, #00a868) 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,208,132,0.35);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.hw-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,208,132,0.45);
}

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

.hw-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── OTP Step Container ─────────────────────────────────── */
.hw-otp-box {
  display: none;
  text-align: center;
  padding: 10px 0;
}

.hw-otp-box.active {
  display: block;
}

.hw-otp-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  direction: ltr;
}

.hw-otp-digit {
  width: 52px;
  height: 58px;
  border-radius: 12px;
  border: 2px solid var(--ln, rgba(0,0,0,0.12));
  background: var(--bg, #f5fdf9);
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  color: var(--ink, #0a1f16);
  outline: none;
  transition: all 0.2s ease;
}

[data-theme="dark"] .hw-otp-digit {
  background: rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.1);
}

.hw-otp-digit:focus {
  border-color: var(--green, #00d084);
  box-shadow: 0 0 0 3px rgba(0,208,132,0.2);
  background: #ffffff;
}

[data-theme="dark"] .hw-otp-digit:focus {
  background: #0d2218;
}

.hw-otp-timer {
  font-size: 0.85rem;
  color: var(--ink3, #5a7a6e);
  margin-bottom: 16px;
}

.hw-resend-link {
  color: var(--green, #00d084);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
}

/* ── Success Card ───────────────────────────────────────── */
.hw-success-card {
  display: none;
  text-align: center;
  padding: 30px 15px;
}

.hw-success-card.active {
  display: block;
}

.hw-success-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green, #00d084), var(--green-d, #00a868));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 10px 30px rgba(0,208,132,0.35);
  animation: hwScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hwScaleIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.hw-success-icon svg {
  width: 36px;
  height: 36px;
}

.hw-success-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ink, #0a1f16);
  margin-bottom: 8px;
}

.hw-success-desc {
  font-size: 0.95rem;
  color: var(--ink3, #5a7a6e);
  line-height: 1.6;
  max-width: 440px;
  margin: 0 auto 24px;
}

/* ── Header Buttons Styling ─────────────────────────────── */
.hw-header-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hw-btn-login {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--rs, 10px);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink, #0a1f16);
  background: var(--bg2, #ffffff);
  border: 1.5px solid var(--ln, rgba(0,0,0,0.1));
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

[data-theme="dark"] .hw-btn-login {
  background: var(--bgc, #0d1e15);
  border-color: rgba(255,255,255,0.1);
  color: var(--ink, #e2f4ec);
}

.hw-btn-login:hover {
  border-color: var(--green, #00d084);
  color: var(--green, #00d084);
  background: var(--g10, rgba(0,208,132,0.08));
  transform: translateY(-2px);
}

.hw-btn-login svg {
  width: 16px;
  height: 16px;
}

.hw-btn-register {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--rs, 10px);
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green, #00d084) 0%, var(--green-d, #00a868) 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,208,132,0.3);
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.hw-btn-register:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,208,132,0.45);
  color: #fff;
}

.hw-btn-register svg {
  width: 16px;
  height: 16px;
}

/* ── User Logged-in Dropdown in Header ───────────────────── */
.hw-user-menu {
  position: relative;
  display: inline-block;
}

.hw-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--rs, 10px);
  background: var(--g10, rgba(0,208,132,0.08));
  border: 1.5px solid var(--lng, rgba(0,208,132,0.25));
  color: var(--green-d, #00a868);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .hw-user-badge {
  color: var(--green-l, #00e896);
}

.hw-user-badge:hover {
  background: var(--green, #00d084);
  color: #ffffff;
}

.hw-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg2, #ffffff);
  border: 1px solid var(--ln, rgba(0,0,0,0.08));
  border-radius: 12px;
  min-width: 180px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.12);
  padding: 8px 0;
  display: none;
  z-index: 1001;
}

[dir="rtl"] .hw-user-dropdown {
  left: auto;
  right: 0;
}

[data-theme="dark"] .hw-user-dropdown {
  background: #0d1e15;
  border-color: rgba(255,255,255,0.08);
}

.hw-user-menu:hover .hw-user-dropdown {
  display: block;
}

.hw-user-dropdown a,
.hw-user-dropdown button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink, #0a1f16);
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.hw-user-dropdown a:hover,
.hw-user-dropdown button:hover {
  background: var(--g10, rgba(0,208,132,0.08));
  color: var(--green, #00d084);
}

.hw-user-dropdown .logout-item {
  color: #ff4d4f;
  border-top: 1px solid var(--ln, rgba(0,0,0,0.06));
  margin-top: 4px;
  padding-top: 10px;
}

.hw-user-dropdown .logout-item:hover {
  background: rgba(255,77,79,0.08);
  color: #ff4d4f;
}

/* ── Mobile Menu Auth Buttons ───────────────────────────── */
.hw-mmenu-auth {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--ln, rgba(0,0,0,0.08));
  margin-top: 14px;
}

.hw-mmenu-auth .hw-btn-login,
.hw-mmenu-auth .hw-btn-register {
  width: 100%;
  height: 44px;
  justify-content: center;
  font-size: 0.92rem;
}

/* ── Standalone Page Wrapper ────────────────────────────── */
.hw-auth-page-section {
  padding: 130px 0 90px;
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hw-auth-page-card {
  background: var(--bg2, #ffffff);
  border: 1px solid var(--ln, rgba(0,0,0,0.08));
  border-radius: 24px;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.06);
  overflow: hidden;
}

[data-theme="dark"] .hw-auth-page-card {
  background: #0d1e15;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 25px 70px rgba(0,0,0,0.45);
}

.hw-auth-page-card .hw-modal-head {
  position: static;
}
