/* דף הכניסה — RTL, מותאם לאייפון. עומד בפני עצמו ואינו תלוי בעיצוב הצ׳אט. */

:root {
  --bg: #0f1115;
  --card: #171a21;
  --line: #262b36;
  --text: #e9edf5;
  --dim: #9aa4b8;
  --accent: #6aa6ff;
  --bad: #ff7b72;
  --good: #6ee7a8;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Heebo", Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding:
    calc(env(safe-area-inset-top) + 24px)
    calc(env(safe-area-inset-right) + 18px)
    calc(env(safe-area-inset-bottom) + 24px)
    calc(env(safe-area-inset-left) + 18px);
}

.card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.logo {
  font-size: 40px;
  line-height: 1;
}

h1 {
  margin: 12px 0 6px;
  font-size: 22px;
  font-weight: 600;
}

.sub {
  margin: 0 0 20px;
  color: var(--dim);
  font-size: 14px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input[type="password"] {
  /* 16px ומעלה — כדי שהאייפון לא יזום בלחיצה על השדה */
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  background: #0f1218;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px;
  min-height: 48px;
  text-align: center;
  letter-spacing: 2px;
  direction: ltr;
}

input[type="password"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

/* שדה שם המכשיר במסך רישום ה־Passkey */
input[type="text"] {
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  background: #0f1218;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px;
  min-height: 48px;
  text-align: center;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button {
  font-size: 17px;
  font-family: inherit;
  font-weight: 600;
  color: #0b1220;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  min-height: 48px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

/* כניסת Face ID — הכפתור הראשי, מעל הסיסמה */

#passkey-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

button.primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  font-size: 18px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.hint {
  margin: 12px 0 0;
  color: var(--dim);
  font-size: 12.5px;
}

.message {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--bad);
  min-height: 20px;
}

.message.ok {
  color: var(--good);
}

.message.note {
  color: var(--dim);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f4f8;
    --card: #ffffff;
    --line: #dfe4ec;
    --text: #10131a;
    --dim: #5c6678;
  }

  input[type="password"],
  input[type="text"] {
    background: #f7f9fc;
  }
}
