:root {
  --primary: #041e42;
  --secondary: #013559;
  --accent: #1d4f91;
  --bg: #ffffff;
  --text: #0f1e3a;
  --muted: #6c86aa;
  --card: #ffffff;
  --border: #abcae9;
  --divider: #e8eff7;
  --ok: #1e824c;
  --danger: #b42318;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --gutter: clamp(10px, 2vw, 24px);
  --pad: clamp(10px, 2.2vw, 22px);
  --gap: clamp(.5rem, 1.2vw, .9rem);
  --fs-body: clamp(13px, 1.3vw, 16px);
  --fs-small: clamp(12px, 1.1vw, 14px);
  --focus: #cfe3fb;
  --page-w: min(520px, 100% - var(--gutter) * 2);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Tajawal", sans-serif;
  /* Added background image with overlay */
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url("../assets/background.png") center / cover
    no-repeat fixed;
  color: var(--text);
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.55;
  overflow-x: hidden;
}

.app-bar {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: .8rem var(--gutter);
  display: flex;
  justify-content: center;
  box-shadow: var(--shadow);
}

.app-logo {
  font-weight: 800;
}

/* Removed blob shapes styling since we're using background image */

main.page {
  width: var(--page-w);
  margin: 0 auto;
  padding: var(--gutter) 0;
  display: grid;
  gap: 12px;
}

h1.title {
  font-weight: 800;
  /* Made title white with text shadow for readability on background */
  color: #ffffff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
  font-size: clamp(22px, 4vw, 36px);
  text-align: center;
}

p.subtitle {
  text-align: center;
  /* Made subtitle white with text shadow for readability on background */
  color: #ffffff;
  text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.6);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
  display: grid;
  gap: var(--gap);
}

.field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.field label {
  font-weight: 700;
  color: #0f2b55;
  font-size: var(--fs-small);
}

.field input {
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 44px;
  transition: .15s;
  font-size: max(16px, var(--fs-body));
}

.field input:focus {
  outline: 2px solid var(--focus);
  border-color: #86b5ea;
  background: #f9fbff;
}

.input-affix {
  position: relative;
  width: 100%;
}

.input-affix input {
  width: 100%;
}

.input-affix button {
  position: absolute;
  top: 50%;
  left: .6rem;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
}

.row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem;
}

.consent {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: var(--fs-small);
}

.btn {
  padding: .7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--secondary);
  cursor: pointer;
  font-weight: 800;
  width: 100%;
  min-height: 44px;
  transition: .15s;
}

.btn:hover {
  background: #f4f8ff;
  border-color: #9fc2e9;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #164074;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.spinner {
  display: none;
}

.links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: var(--fs-small);
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.link:hover {
  text-decoration: underline;
}

.msg {
  display: none;
  font-size: var(--fs-small);
  padding: .6rem .8rem;
  border-radius: 10px;
  text-align: right;
  border: 1px solid transparent;
}

.msg.err {
  background: #fdecea;
  color: #8a1c1c;
  border-color: #f5c2c7;
}

.msg.ok {
  background: #e8f5e9;
  color: #1b5e20;
  border-color: #b4e0b9;
}

.error-msg {
  display: none;
  margin-bottom: 4px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 13px;
  background: #fdecec;
  color: #842029;
  border: 1px solid #f5c2c7;
}
@supports (-webkit-touch-callout: none) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}
/* Remove default browser password-eye */
input::-ms-reveal,
input::-ms-clear {
  display: none !important;
}

input::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  display: none !important;
}

/* Custom eye icons */
.toggle-eye {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  color: var(--muted);
}

.toggle-eye:hover {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

/* Add padding so icon doesn't overlap text */
.input-affix input {
  padding-left: 40px;
}
