/* iPlace student form: inline + pop-up. Both languages are RTL. */
.ips {
	--ips-blue: #066AAB;
	--ips-blue-dark: #055a92;
	--ips-head: #002639;
	--ips-text: #1d1d1f;
	--ips-muted: #6e6e73;
	--ips-line: #d2d2d7;
	--ips-bg: #ffffff;
	--ips-err: #d70015;
	--ips-ok: #1d8348;
	font-family: "Rubik", -apple-system, "Segoe UI", Arial, sans-serif;
	color: var(--ips-text);
	direction: rtl;
	max-width: 560px;
	margin-inline: auto;
	text-align: right;
	position: relative;
}
.ips * { box-sizing: border-box; }

.ips__title { margin: 0 0 6px; font-size: 26px; line-height: 1.25; font-weight: 700; }
.ips__intro { margin: 0 0 12px; color: var(--ips-muted); font-size: 15px; line-height: 1.6; }
.ips__who { margin: 0 0 14px; font-size: 13px; color: var(--ips-muted); }
.ips__state { padding: 16px 18px; border-radius: 12px; background: #f5f5f7; font-size: 16px; line-height: 1.6; }
.ips__state--approved { background: #eaf7ee; color: var(--ips-ok); }

.ips__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .ips__row { grid-template-columns: 1fr; gap: 0; } }

.ips__field { margin: 0 0 14px; }
.ips__field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.ips__field input[type="text"],
.ips__field input[type="email"],
.ips__field input[type="tel"],
.ips__field input[type="date"],
.ips__field input[type="file"] {
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	border: 1px solid var(--ips-line);
	border-radius: 12px;
	background: var(--ips-bg);
	font: inherit;
	font-family: "Rubik", sans-serif;
	font-size: 16px; /* 16px stops iOS zoom on focus */
	color: inherit;
	direction: rtl;
	text-align: right;
	transition: border-color .15s, box-shadow .15s;
}
.ips__field input[type="email"],
.ips__field input[type="tel"],
.ips__field input[type="date"] { direction: ltr; text-align: right; } /* Latin/digits read correctly, still right-aligned */
.ips__field input[type="file"] { padding: 9px 12px; background: #fafafa; }
.ips__field input:focus-visible {
	outline: none;
	border-color: var(--ips-blue);
	box-shadow: 0 0 0 3px rgba(0, 113, 227, .2);
}
.ips__field.is-invalid input { border-color: var(--ips-err); }
.ips__help { display: block; margin-top: 4px; color: var(--ips-muted); font-size: 12.5px; }
.ips__err { display: block; min-height: 0; margin-top: 4px; color: var(--ips-err); font-size: 13px; }
.ips__err:empty { display: none; }

.ips__check { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 400 !important; font-size: 13.5px !important; line-height: 1.55; cursor: pointer; }
.ips__check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ips-blue); }

.ips__hp { position: absolute !important; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); pointer-events: none; }

.ips__status { min-height: 0; margin: 0 0 10px; font-size: 14px; color: var(--ips-err); }
.ips__status:empty { display: none; }

.ips__submit {
	display: block; width: 100%; min-height: 50px; padding: 12px 24px;
	border: 0; border-radius: 980px; background: #066AAB; color: #fff;
	font: inherit; font-family: "Rubik", sans-serif; font-size: 17px; font-weight: 600; cursor: pointer;
	transition: background .15s, opacity .15s;
}
.ips__submit:hover { background: #055a92; color: #fff; }
.ips__submit:focus-visible { outline: 3px solid rgba(0, 113, 227, .35); outline-offset: 2px; }
.ips__submit[disabled] { opacity: .6; cursor: progress; }

.ips__done { text-align: center; padding: 24px 8px; }
.ips__done[hidden] { display: none; }
.ips__done:focus { outline: none; }
.ips__check-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: #eaf7ee; color: var(--ips-ok); font-size: 34px; line-height: 64px; }
.ips__done h3 { margin: 0 0 8px; font-size: 22px; }
.ips__done p { margin: 0; color: var(--ips-muted); line-height: 1.6; }

/* Pop-up */
.ips-dialog {
	width: min(600px, calc(100vw - 24px));
	max-height: calc(100vh - 24px);
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	font-family: "Rubik", sans-serif;
}
.ips-dialog .ips { padding: 0 30px 28px; max-width: none; }
/* Dark header band with the white title; 30px space above and below. */
.ips-dialog .ips__title {
	margin: 0 -28px 20px;
	padding: 30px 28px;
	background: var(--ips-head);
	color: #fff;
	font-size: 24px;
	font-weight: 600;
}
.ips-dialog::backdrop { background: rgba(0, 0, 0, .5); backdrop-filter: blur(3px); }
.ips-dialog[open] { animation: ips-pop .22s ease-out; }
@keyframes ips-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.ips-dialog__close {
	position: absolute; top: 14px; left: 16px; right: auto; z-index: 2;
	width: 36px; height: 36px; border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, .15); color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
}
.ips-dialog__close:hover { background: rgba(255, 255, 255, .3); }
@media (max-width: 520px) { .ips-dialog .ips { padding: 0 18px 22px; } .ips-dialog .ips__title { margin-inline: -18px; padding: 30px 18px; font-size: 21px; } }
@media (prefers-reduced-motion: reduce) { .ips-dialog[open] { animation: none; } }

/* Login box */
.ips__code { text-align: center; font-size: 28px !important; letter-spacing: .5em; font-variant-numeric: tabular-nums; }
.ips__form[hidden] { display: none; }
.ips__links { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 4px; }
.ips__link { background: none; border: 0; padding: 4px 0; color: var(--ips-blue); font: inherit; font-size: 14px; cursor: pointer; }
.ips__link[disabled] { color: var(--ips-muted); cursor: default; }
.ips__link:not([disabled]):hover { text-decoration: underline; }

/* Student price badge (shop, product page) */
.ips-student-badge {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 2px 10px;
	border-radius: 999px;
	background: #e8f1fd;
	color: #0058b0;
	font-size: .72em;
	font-weight: 700;
	line-height: 1.6;
	white-space: nowrap;
	vertical-align: middle;
}

/* Expired-student banner */
.ips-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; padding: 10px 44px 10px 16px; background: #fff4d6; color: #5c4400; font: 500 15px/1.5 -apple-system, "Segoe UI", "Noto Sans Hebrew", "Noto Sans Arabic", Arial, sans-serif; position: relative; text-align: center; }
.ips-banner[hidden] { display: none; }
.ips-banner__btn { border: 0; border-radius: 980px; background: #0071e3; color: #fff; padding: 7px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.ips-banner__btn:hover { background: #0058b0; }
.ips-banner__x { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 22px; line-height: 1; color: inherit; cursor: pointer; }

/* Theme/Elementor button styles are strong: pin our colours so they always win. */
.ips .ips__submit,
.ips .ips__submit:focus,
.ips .ips__submit:active { background: #066AAB !important; background-color: #066AAB !important; color: #fff !important; border: 0 !important; box-shadow: none; }
.ips .ips__submit:hover { background: #055a92 !important; background-color: #055a92 !important; color: #fff !important; }
.ips-dialog .ips-dialog__close,
.ips-dialog .ips-dialog__close:focus,
.ips-dialog .ips-dialog__close:active {
	position: absolute; top: 30px; left: 20px; right: auto;
	width: 36px; height: 36px; min-width: 0; padding: 0; margin: 0;
	display: flex; align-items: center; justify-content: center;
	background: transparent !important; color: #fff !important; border: 0 !important; box-shadow: none;
	font-size: 30px; line-height: 1; border-radius: 50%;
}
.ips-dialog .ips-dialog__close:hover { background: rgba(255, 255, 255, .18) !important; color: #fff !important; }
.ips-dialog .ips__title { line-height: 36px; }
.ips__intro[hidden] { display: none !important; }
.ips.is-done .ips__intro, .ips__intro[hidden] { display: none !important; }

/* ---- Login box + mobile polish ---- */
.ips-dialog { max-height: calc(var(--ips-vh, 100dvh) - 16px); }
.ips .ips__field input:not([type="checkbox"]) { color: #1d1d1f !important; background-color: #fff !important; -webkit-text-fill-color: #1d1d1f; opacity: 1; }
.ips .ips__field input[type="file"] { background-color: #fafafa !important; }
.ips--login .ips__intro { margin-bottom: 18px; }
.ips .ips__code { text-align: center !important; direction: ltr; letter-spacing: .4em; font-size: 26px !important; }
.ips .ips__links { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 18px 0 0; padding: 0; }
.ips .ips__link,
.ips .ips__link:focus,
.ips .ips__link:active { background: none !important; border: 0 !important; box-shadow: none; padding: 8px 12px; min-height: 0; width: auto; color: #066AAB !important; font: inherit; font-family: "Rubik", sans-serif; font-size: 15px; text-decoration: none; cursor: pointer; }
.ips .ips__link:hover { background: none !important; text-decoration: underline; }
.ips .ips__link[disabled] { color: #8a8a90 !important; cursor: default; text-decoration: none; }
.ips .ips__help[data-ips-login-timer] { text-align: center; margin-top: 2px; }
.ips--login.is-done .ips__intro { display: none !important; }
.ips .ips__done h3 { font-family: "Rubik", sans-serif; color: var(--ips-text); }
@media (max-width: 520px) {
	/* sit near the top so the on-screen keyboard never covers the fields */
	.ips-dialog { width: calc(100vw - 32px); margin: 8px auto auto; }
	.ips-dialog .ips { padding: 0 22px 24px; }
	.ips-dialog .ips__title { margin-inline: -20px; padding: 30px 20px; }
	.ips-dialog .ips-dialog__close { left: 12px; }
	.ips .ips__submit { width: 100%; }
}

/* ---- layout fixes from QA ---- */
.ips-dialog .ips__title { margin-inline: -30px; padding: 30px 30px 30px 66px; } /* left room for the X, no overlap */
.ips-dialog .ips-dialog__close:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.ips-dialog .ips-dialog__close:focus-visible { outline: 2px solid #fff; outline-offset: 0; }
@media (max-width: 520px) { .ips-dialog .ips__title { margin-inline: -22px; padding: 30px 22px 30px 62px; } }
.ips-dialog .ips__title { box-shadow: 2px 0 0 var(--ips-head), -2px 0 0 var(--ips-head); } /* no hairline at the header edges */

/* ---- 0.1.9: mobile pop-up spacing, clear X / title separation, keyboard-safe ---- */
@media (max-width: 520px) {
	.ips-dialog {
		position: fixed; left: 0; right: 0; margin: 0 auto;
		top: var(--ips-top, 16px); bottom: auto;
		width: calc(100vw - 32px);
		max-height: calc(var(--ips-vh, 100dvh) - 32px);
	}
	/* X sits alone on its own row above the title */
	.ips-dialog .ips-dialog__close { top: 10px; left: 10px; }
	.ips-dialog .ips__title { padding: 56px 22px 22px; text-align: center; font-size: 21px; line-height: 30px; }
	/* keyboard open: compact header, hide the intro so the field stays visible */
	html.ips-kb .ips-dialog .ips__title { padding: 46px 22px 12px; font-size: 18px; line-height: 24px; }
	html.ips-kb .ips-dialog .ips__intro { display: none !important; }
	html.ips-kb .ips-dialog .ips-dialog__close { top: 6px; }
}

/* ---- 0.1.10: phone pop-up = full-screen scroller, card pinned to the top ----
   The browser itself scrolls the focused field above the keyboard; the card is never centred. */
@media (max-width: 520px) {
	.ips-dialog {
		position: fixed; inset: 0; margin: 0; width: 100%; max-width: none;
		height: 100%; max-height: none;
		background: transparent; box-shadow: none; border-radius: 0;
		padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
		overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
		box-sizing: border-box;
	}
	.ips-dialog > .ips { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 80px rgba(0, 0, 0, .28); }
	.ips-dialog .ips-dialog__close { top: 26px; left: 26px; }
	html.ips-kb .ips-dialog { padding-bottom: 60vh; }
	html.ips-kb .ips-dialog .ips-dialog__close { top: 22px; }
}
