/* =========================================================================
   auth.css
   The sign-in surface: login.php, the one screen both areas sign in from -
   the mentor form and the student form as cards side by side.

   It was the last screen still on the pre-redesign markup - bare <table> rows
   of unstyled inputs on a white page, with a green "כניסה" button. Everything
   here is built from the design-tokens.css variables so it now matches the
   rest of the app, and both cards give their input fields the same visible
   emphasis.
   ========================================================================= */

.auth-page {
  font-family: var(--font-family);
  max-width: 60rem;
  margin: 0 auto;
  /* Clears the fixed 3.5rem top bar from layout/header.php. */
  padding: 112px 24px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- Masthead ---- */
.auth-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--brand-blue);
  box-shadow: var(--shadow-cta);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.auth-logo--student {
  background: var(--accent-orange);
  box-shadow: 0 16px 34px -10px rgba(249, 115, 22, .5);
}

.auth-title {
  margin: 0;
  font-size: 32px;
  font-weight: var(--fw-heading);
  color: var(--text-primary);
}

.auth-subtitle {
  margin: 6px 0 0;
  font-size: 16px;
  color: var(--text-muted);
}

/* ---- The two areas on the home screen ---- */
.auth-areas {
  display: grid;
  /* One column on phones; the mentor card gets the extra room on desktop
     because it holds the form. */
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  width: 100%;
  align-items: start;
}

@media (max-width: 760px) {
  .auth-areas { grid-template-columns: minmax(0, 1fr); }
}

.auth-card {
  padding: 26px;
  display: flex;
  flex-direction: column;
}

/* A single centred card - used by the student sign-in screen. */
.auth-card--solo {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
}

.auth-card--primary { box-shadow: var(--shadow-card-blue); }

.auth-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card-icon--blue   { background: var(--blue-50);   color: var(--brand-blue); }
.auth-card-icon--orange { background: #fff7ed;          color: var(--accent-orange); }

.auth-card-title {
  margin: 0;
  font-size: 19px;
  font-weight: var(--fw-heading);
  color: var(--text-primary);
}

.auth-card-sub {
  margin: 2px 0 0;
  font-size: var(--fs-body);
  color: var(--text-muted);
}

.auth-card-body {
  margin: 0 0 20px;
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text-secondary);
  flex: 1 1 auto;
}

/* ---- Form ---- */
.auth-form {
  display: flex;
  flex-direction: column;
}

/* The emphasis the mentor fields already had, now shared by the student
   fields: a taller box, a real border and a blue focus ring, so it is
   obvious where the details go. */
.auth-input {
  height: 44px;
  font-size: 15px;
  background: var(--surface-2);
  border: 1px solid var(--gray-300);
}

.auth-input:focus,
.auth-input:focus-visible {
  background: var(--surface-1);
  border-color: var(--blue-500);
  box-shadow: var(--focus-ring);
}

/* These password fields keep dir="ltr" (so typed digits/latin text don't
   reverse), but right-aligning the text/placeholder matches the rest of
   the RTL form - and sits it next to the toggle icon - instead of drifting
   to the left edge of the box. */
.auth-input--align-right { text-align: right; }

/* Wraps a password input together with its show/hide toggle. Both password
   fields keep dir="ltr", so the toggle sits at their visual end (right). */
.auth-field { position: relative; }

.auth-field .auth-input { padding-right: 42px; }

.auth-toggle-password {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.auth-toggle-password:hover,
.auth-toggle-password:focus-visible {
  color: var(--brand-blue);
  background: var(--blue-50);
}

.auth-submit {
  width: 100%;
  height: 46px;
  font-size: 15px;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.auth-submit--orange {
  background: var(--accent-orange);
  color: #fff;
}

.auth-submit--orange:hover,
.auth-submit--orange:focus-visible {
  background: #ea580c;
  color: #fff;
  text-decoration: none;
}

.auth-link-btn {
  align-self: center;
  margin-top: 14px;
  background: transparent;
  border: 0;
  padding: 4px 8px;
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.auth-link-btn:hover,
.auth-link-btn:focus-visible {
  color: var(--brand-blue);
  background: var(--blue-50);
}

/* ---- Status line ----
   Reserves its own row so the button never shifts when a message appears.
   The old screens printed this in pale yellow on white, which was close to
   invisible. */
.auth-message {
  min-height: 20px;
  margin: 2px 0 14px;
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  line-height: 1.5;
  text-align: center;
}

.auth-message.is-error { color: var(--destructive); }
.auth-message.is-ok    { color: var(--success); }

/* ---- Cross-link between the two sign-in screens ---- */
.auth-alt {
  margin-top: 26px;
  font-size: var(--fs-body);
  color: var(--text-muted);
  text-align: center;
}

.auth-alt a {
  font-weight: var(--fw-semibold);
  color: var(--brand-blue);
  text-decoration: none;
}

.auth-alt a:hover { text-decoration: underline; }
