/* ===============================
   VARIABLES
=================================*/
:root {
  --primary-color: #4a90e2;
  --secondary-color: #50e3c2;
  --bg-gradient-start: #f5f7fa;
  --bg-gradient-end: #c3cfe2;
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===============================
   RESET
=================================*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: linear-gradient(
    135deg,
    var(--bg-gradient-start),
    var(--bg-gradient-end)
  );
  direction: rtl;
}

/* ===============================
   PAGE WRAPPER (מרכז למסכי auth בלבד)
=================================*/
.page-wrapper {
  min-height: calc(100vh - 80px); /* משאיר מקום ל-footer */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ===============================
   AUTH CARD
=================================*/
.auth-container {
  width: min(92vw, 400px);
  background: #fff;
  padding: clamp(18px, 4vw, 30px);
  border-radius: 18px;
  box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.1);
}

.auth-title {
  text-align: center;
  color: var(--primary-color);
  font-weight: 600;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  margin-bottom: 20px;
}

/* ===============================
   FORM FIELDS
=================================*/
.mb-3 {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-weight: 500;
  font-size: clamp(0.9rem, 3.5vw, 1rem);
}

.form-control {
  font-size: 16px; /* מונע zoom במובייל */
  border-radius: 0.5rem;
  padding: 12px;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0.5rem rgba(74,144,226,0.3);
}

/* ===============================
   BUTTONS
=================================*/
.btn {
  font-size: 16px;
  padding: 12px;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: #357ab8;
  border-color: #357ab8;
}

.btn-success {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-success:hover {
  background-color: #3bb197;
  border-color: #3bb197;
}

/* ===============================
   LINKS
=================================*/
a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

a:hover {
  color: #357ab8;
}

/* ===============================
   ERROR BOX
=================================*/
#errorBox {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;

  width: min(92vw, 400px);
  padding: 12px 16px;
  border-radius: 8px;

  font-weight: bold;
  font-size: 16px;
  text-align: center;

  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#errorBox.success {
  background-color: #28a745;
  color: #fff;
}

#errorBox.error {
  background-color: #dc3545;
  color: #fff;
}

/* ===============================
   PASSWORD TOGGLE
=================================*/
.password-wrapper {
  position: relative;
}

#password {
  padding-left: 44px;
}

#togglePassword {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.6;
  font-size: 20px;
}

/* ===============================
   CLEAR FIELDS BUTTON
=================================*/
#clearFieldsBtn {
  position: absolute;
  bottom: 12px;
  left: 12px;

  width: 26px;
  height: 26px;

  border: 2px solid #0d6efd;
  border-radius: 50%;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
}

#clearFieldsBtn::before {
  content: "🗑️";
  font-size: 14px;
}

#clearFieldsBtn::after {
  content: "ניקוי שדות";
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: #0d6efd;
  white-space: nowrap;
}

/* ===============================
   FOOTER (קטן ויציב)
=================================*/
.ap-footer {
  background: #1f2a44;
  color: white;
  padding: 15px 0;
  font-size: 14px;
  text-align: center;
}

.ap-footer a {
  color: #d6dfff;
  text-decoration: none;
}

.ap-footer a:hover {
  color: white;
}

/* פוטר קומפקטי למסך כניסה */
.ap-footer-compact {
  padding: 10px 16px;
  font-size: 12px;
  text-align: center;
  max-width: 520px;
  margin: 0 auto 0;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.ap-footer-compact-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
}

.ap-footer-compact .ap-footer-brand,
.ap-footer-compact .ap-footer-links,
.ap-footer-compact .ap-footer-copy {
  color: rgba(255, 255, 255, 0.95);
}

.ap-footer-compact .ap-footer-links a {
  color: #b8c9ff;
}

.ap-footer-compact .ap-footer-links a:hover {
  color: #fff;
}

@media (max-width: 576px) {
  .auth-container {
    padding: 20px;
    border-radius: 14px;
  }
}

.auth-container {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-container:hover {
  transform: translateY(-3px);
  box-shadow: 0 1rem 2rem rgba(0,0,0,0.12);
}

.auth-title {
  background: linear-gradient(90deg, #4a90e2, #357ab8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (max-width: 576px) {
  .ap-footer {
    font-size: 12px;
    padding: 10px 0;
  }

  .ap-footer-compact {
    max-width: 92%;
    padding: 8px 12px;
    font-size: 11px;
  }

  .ap-footer-compact-inner {
    gap: 0.35rem 0.75rem;
  }
}