/* MK Login – front end. Five templates: classic, split, minimal, rounded, dark (+ optional auto dark). */
.mk-auth, .mk-acc {
	--mk-primary: #D32F2F;
	--mk-primary-ink: #fff;
	--mk-primary-soft: color-mix(in srgb, var(--mk-primary) 10%, #fff);
	--mk-bg: transparent;
	--mk-surface: #fff;
	--mk-text: #1d2433;
	--mk-heading: #111827;
	--mk-page-heading: #111827;
	--mk-muted: #374151;
	--mk-border: #e3e6ec;
	--mk-field: #fff;
	--mk-field-border: #d5d9e1;
	--mk-focus: color-mix(in srgb, var(--mk-primary) 22%, transparent);
	--mk-ok: #1b8a4b;
	--mk-err: #c62828;
	--mk-radius: 12px;
	--mk-field-radius: 10px;
	--mk-shadow: 0 12px 32px rgba(16, 24, 40, .08), 0 2px 6px rgba(16, 24, 40, .04);
	--mk-font: var(--mk-site-font, inherit);
	direction: rtl;
	text-align: right;
	font-family: var(--mk-font);
	color-scheme: light;
	color: var(--mk-text);
	box-sizing: border-box;
}
@supports not (color: color-mix(in srgb, red 10%, white)) {
	.mk-auth, .mk-acc { --mk-primary-soft: #fdecec; --mk-focus: rgba(211, 47, 47, .2); }
}
.mk-auth *, .mk-auth *::before, .mk-auth *::after,
.mk-acc *, .mk-acc *::before, .mk-acc *::after { box-sizing: border-box; }

.mk-auth [hidden], .mk-acc [hidden] { display: none !important; }
.mk-auth { max-width: var(--mk-max, 460px); margin: 24px auto; line-height: 1.8; }
.mk-auth__card { background: var(--mk-surface); border: 1px solid var(--mk-border); border-radius: var(--mk-radius); box-shadow: var(--mk-shadow); overflow: hidden; }
.mk-auth__main { padding: 28px 28px 24px; }
.mk-auth__logo { display: block; max-height: 64px; width: auto; margin: 0 auto 12px; }
.mk-auth__title { font-size: 1.35rem; font-weight: 800; margin: 0 0 4px; color: var(--mk-text); line-height: 1.5; }
.mk-auth__sub { color: var(--mk-muted); margin: 0 0 18px; font-size: .92rem; font-weight: 500; }

.mk-label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 6px; color: var(--mk-text); }
.mk-req { color: var(--mk-primary); font-weight: 700; }
.mk-opt { color: var(--mk-muted); font-weight: 400; font-size: .82em; }
.mk-input, .mk-auth select, .mk-acc select {
	width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--mk-text);
	background: var(--mk-field); border: 1px solid var(--mk-field-border); border-radius: var(--mk-field-radius);
	outline: none; transition: border-color .15s, box-shadow .15s; margin: 0; box-shadow: none; appearance: auto;
}
.mk-input:focus, .mk-auth select:focus, .mk-acc select:focus { border-color: var(--mk-primary); box-shadow: 0 0 0 4px var(--mk-focus); }
.mk-input[readonly] { background: color-mix(in srgb, var(--mk-field) 92%, var(--mk-text)); }
.mk-input::placeholder { color: #6b7280; opacity: 1; }
[dir=ltr].mk-input, .mk-input[dir=ltr] { text-align: left; }

.mk-phone { display: flex; align-items: stretch; gap: 0; border-radius: var(--mk-field-radius); }
/* Country selector (only when international numbers are enabled) sits on the left of the number. */
.mk-phone .mk-country { width: auto; max-width: 45%; order: 2; border-radius: var(--mk-field-radius) 0 0 var(--mk-field-radius); border-right: 0; }
.mk-phone__input { order: 1; border-radius: var(--mk-field-radius); letter-spacing: .5px; min-width: 0; }
.mk-phone .mk-country:not([hidden]) + .mk-phone__input { border-radius: 0 var(--mk-field-radius) var(--mk-field-radius) 0; }
.mk-country[hidden] { display: none !important; }

.mk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 12px; padding: 10px 18px; border: 0; border-radius: var(--mk-field-radius); font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; transition: filter .15s, transform .05s, opacity .15s; text-decoration: none; }
.mk-btn--primary { background: var(--mk-primary); color: var(--mk-primary-ink); }
.mk-btn--primary:hover { filter: brightness(.93); }
.mk-btn:active { transform: translateY(1px); }
.mk-btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.mk-btn--ghost { background: transparent; color: var(--mk-primary); border: 1px solid var(--mk-primary); }
.mk-link { background: none; border: 0; padding: 0; color: var(--mk-primary); font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none; }
.mk-link:hover { text-decoration: underline; }

.mk-step + .mk-step { margin-top: 18px; }
.mk-code-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: .9rem; color: var(--mk-muted); margin-bottom: 8px; }
.mk-code-head b { color: var(--mk-text); }
.mk-code-row { display: flex; align-items: center; gap: 10px; }
.mk-code { text-align: center !important; font-size: 1.5rem !important; letter-spacing: .5em; font-weight: 700; max-width: 220px; }
.mk-code-status { font-size: .88rem; }
.mk-code-status.is-ok { color: var(--mk-ok); font-weight: 700; }
.mk-code-status.is-error { color: var(--mk-err); }
.mk-code-status.is-busy { color: var(--mk-muted); }
.mk-resend { margin-top: 6px; font-size: .85rem; color: var(--mk-muted); min-height: 1.6em; }

.mk-hint { background: var(--mk-primary-soft); border-radius: var(--mk-field-radius); padding: 10px 12px; font-size: .88rem; margin: 0 0 14px; color: var(--mk-text); }
.mk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.mk-field { margin-bottom: 12px; }
.mk-err { display: block; color: var(--mk-err); font-size: .8rem; min-height: 0; margin-top: 3px; }
.mk-field.has-error .mk-input, .mk-field.has-error select { border-color: var(--mk-err); }
.mk-birth { display: grid; grid-template-columns: 1fr 1.4fr 1.2fr; gap: 8px; }
.mk-province-text, .mk-city-text { margin-top: 6px; }

.mk-students { border: 1px dashed var(--mk-field-border); border-radius: var(--mk-field-radius); padding: 8px 12px; margin: 4px 0 12px; }
.mk-students summary { cursor: pointer; font-weight: 600; font-size: .92rem; padding: 4px 0; }
.mk-student { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; margin: 8px 0; align-items: center; }
.mk-student .mk-input { min-height: 40px; font-size: .92rem; padding: 6px 8px; }
.mk-student__rm { font-size: 1.4rem; line-height: 1; color: var(--mk-muted); padding: 0 6px; }

.mk-check { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.mk-check input { width: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--mk-primary); flex: 0 0 auto; }
.mk-check a { color: var(--mk-primary); }
.mk-submit-hint { font-size: .78rem; color: var(--mk-muted); text-align: center; margin: 6px 0 0; }
.mk-submit:not(:disabled) + .mk-submit-hint { display: none; }

.mk-alert { border-radius: var(--mk-field-radius); padding: 10px 12px; margin: 0 0 14px; font-size: .9rem; border: 1px solid; }
.mk-alert--error { background: #fdecec; border-color: #f5c2c2; color: #8e1c1c; }
.mk-alert--info { background: #eef4ff; border-color: #c9dafc; color: #1d3f8a; }
.mk-alert--success { background: #eaf7ef; border-color: #b9e3c8; color: #145c33; }
.mk-auth.is-done .mk-form { opacity: .6; pointer-events: none; }
.mk-auth-logged { padding: 16px; border: 1px solid var(--mk-border, #e3e6ec); border-radius: 12px; }

/* Blocks (links, headings, banners) */
.mk-blocks { display: grid; gap: 12px; margin: 0 0 16px; }
.mk-blocks--bottom { margin: 16px 0 0; }
.mk-block { margin: 0; }
.mk-block h1, .mk-block h2, .mk-block h3, .mk-block h4, .mk-block h5, .mk-block h6, .mk-block p { margin: 0; line-height: 1.6; }
.mk-block a { color: var(--mk-primary); text-decoration: none; }
.mk-block a:hover { text-decoration: underline; }
.mk-block--banner img { display: block; width: 100%; height: auto; border-radius: var(--mk-radius); }
.mk-block--text { text-align: center; }

/* ---------------- Template: classic (default) */
.mk-t-classic .mk-auth__card { border-top: 4px solid var(--mk-primary); }

/* ---------------- Template: split (side panel) */
.mk-t-split { --mk-max: 900px !important; max-width: 900px; }
.mk-t-split .mk-auth__card { display: grid; grid-template-columns: 1fr 1.15fr; }
.mk-t-split .mk-auth__side { background: linear-gradient(160deg, var(--mk-primary), color-mix(in srgb, var(--mk-primary) 70%, #000)); color: #fff; padding: 28px; display: flex; flex-direction: column; justify-content: center; }
.mk-t-split .mk-auth__side .mk-block a, .mk-t-split .mk-auth__side .mk-block { color: #fff; }
.mk-t-split .mk-side-default strong { display: block; font-size: 1.5rem; margin-bottom: 8px; }
.mk-t-split .mk-side-default span { opacity: .9; }
.mk-t-split .mk-blocks--side { margin: 0; }

/* ---------------- Template: minimal (no card, underline fields) */
.mk-t-minimal .mk-auth__card { background: transparent; border: 0; box-shadow: none; }
.mk-t-minimal .mk-auth__main { padding: 8px 0; }
.mk-t-minimal .mk-auth__title { font-size: 1.6rem; }
.mk-t-minimal .mk-auth__title::after { content: ""; display: block; width: 48px; height: 3px; background: var(--mk-primary); margin-top: 8px; border-radius: 3px; }
.mk-t-minimal .mk-input, .mk-t-minimal select { border-width: 0 0 2px; border-radius: 0; background: transparent; padding-inline: 2px; }
.mk-t-minimal .mk-input:focus, .mk-t-minimal select:focus { box-shadow: none; }
.mk-t-minimal .mk-phone .mk-country { border-width: 0 0 2px; border-radius: 0; }

/* ---------------- Template: rounded (soft, pill buttons) */
.mk-t-rounded { --mk-radius: 24px; --mk-field-radius: 999px; }
.mk-t-rounded .mk-auth__card { background: linear-gradient(180deg, var(--mk-primary-soft), #fff 140px); border-color: transparent; }
.mk-t-rounded .mk-input, .mk-t-rounded select { padding-inline: 18px; }
.mk-t-rounded .mk-auth__title { text-align: center; }
.mk-t-rounded .mk-auth__sub { text-align: center; }
.mk-t-rounded .mk-students, .mk-t-rounded .mk-hint, .mk-t-rounded .mk-alert { border-radius: 16px; }
.mk-t-rounded .mk-student .mk-input { border-radius: 12px; }

/* ---------------- Template: dark */
.mk-auth.mk-t-dark, .mk-acc.mk-dark {
	color-scheme: dark;
	--mk-surface: #151922; --mk-text: #eef1f6; --mk-heading: #ffffff; --mk-muted: #b6bfcc; --mk-border: #2a3140;
	--mk-field: #1d2330; --mk-field-border: #343c4d; --mk-primary: #ef5350; --mk-primary-soft: #2a1b1f;
	--mk-shadow: 0 16px 40px rgba(0, 0, 0, .45); --mk-ok: #4cc38a; --mk-err: #ff8a80;
}
.mk-t-dark .mk-auth__card { border-top: 4px solid var(--mk-primary); }
.mk-t-dark .mk-alert--error { background: #3a1d1f; border-color: #5c2a2e; color: #ffb4ab; }
.mk-t-dark .mk-alert--info { background: #1b2640; border-color: #2c3d63; color: #b8cbff; }
.mk-t-dark .mk-alert--success { background: #15301f; border-color: #24503a; color: #a6e8c0; }

/* ---------------- Account pages */
.mk-acc { line-height: 1.8; }
.mk-acc h3 { font-size: 1.1rem; margin: 22px 0 10px; }
.mk-acc .mk-card { background: var(--mk-surface); border: 1px solid var(--mk-border); border-radius: var(--mk-radius); padding: 18px; margin-bottom: 16px; }
.mk-acc .mk-row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mk-acc .mk-btn { width: auto; margin-top: 8px; }
.mk-acc .mk-muted { color: var(--mk-muted); font-size: .88rem; }
.mk-acc .mk-badge { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: .78rem; background: var(--mk-primary-soft); color: var(--mk-primary); }
.mk-acc .mk-badge--ok { background: #eaf7ef; color: #145c33; }
.mk-lic { border: 1px solid var(--mk-border); border-radius: var(--mk-radius); padding: 14px 16px; margin-bottom: 12px; }
.mk-lic__head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mk-lic__title { font-weight: 700; }
.mk-lic__key { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.mk-lic__key code { direction: ltr; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--mk-primary-soft); padding: 6px 10px; border-radius: 8px; font-size: .85rem; }

@media (max-width: 720px) {
	.mk-t-split .mk-auth__card { grid-template-columns: 1fr; }
	.mk-t-split .mk-auth__side { padding: 20px; }
}
@media (max-width: 480px) {
	.mk-auth { margin: 12px auto; }
	.mk-auth__main { padding: 20px 16px; }
	.mk-grid { grid-template-columns: 1fr; }
	.mk-student { grid-template-columns: 1fr 1fr; }
	.mk-student select { grid-column: 1 / 2; }
	.mk-code { max-width: none; }
}

/* ---------------- Theme-proof text: themes such as Astra/Elementor style h2, label and inputs
   with more specific selectors (lighter colours / weights). These rules keep our text dark and bold. */
.mk-auth .mk-auth__title, .mk-acc h3, .mk-acc .mk-lic__title,
.mk-auth .mk-label, .mk-acc .mk-label, .mk-auth .mk-students summary, .mk-auth .mk-code-head b {
	color: var(--mk-heading) !important; opacity: 1 !important;
}
.mk-auth .mk-auth__title { font-weight: 800 !important; font-family: var(--mk-font) !important; letter-spacing: 0 !important; text-transform: none !important; }
.mk-acc h3, .mk-acc .mk-lic__title { font-weight: 800 !important; }
.mk-auth .mk-label, .mk-acc .mk-label, .mk-auth .mk-students summary { font-weight: 700 !important; }
.mk-auth .mk-auth__sub, .mk-auth .mk-hint, .mk-auth .mk-check, .mk-auth .mk-code-head, .mk-acc .mk-muted { opacity: 1 !important; }
.mk-auth .mk-auth__sub, .mk-auth .mk-code-head, .mk-acc .mk-muted { color: var(--mk-muted) !important; }
.mk-auth .mk-check span { color: var(--mk-heading); }
.mk-auth .mk-input, .mk-acc .mk-input, .mk-auth select.mk-input, .mk-acc select.mk-input {
	color: var(--mk-heading) !important; -webkit-text-fill-color: var(--mk-heading); opacity: 1 !important; font-weight: 600;
}
.mk-auth .mk-input::placeholder, .mk-acc .mk-input::placeholder { color: #6b7280 !important; -webkit-text-fill-color: #6b7280; font-weight: 400; }
/* Blocks above/below the form sit on the site's own (light) background: they always use the
   light-mode heading colour, even when the form itself is dark. */
.mk-auth .mk-block h1, .mk-auth .mk-block h2, .mk-auth .mk-block h3, .mk-auth .mk-block h4, .mk-auth .mk-block h5, .mk-auth .mk-block h6,
.mk-auth .mk-block p { color: var(--mk-page-heading) !important; opacity: 1 !important; }
.mk-auth .mk-block h1, .mk-auth .mk-block h2, .mk-auth .mk-block h3, .mk-auth .mk-block h4, .mk-auth .mk-block h5, .mk-auth .mk-block h6 { font-weight: 800; }
.mk-auth .mk-block a { color: var(--mk-primary) !important; }
.mk-t-split .mk-auth__side .mk-block h1, .mk-t-split .mk-auth__side .mk-block h2, .mk-t-split .mk-auth__side .mk-block h3,
.mk-t-split .mk-auth__side .mk-block h4, .mk-t-split .mk-auth__side .mk-block h5, .mk-t-split .mk-auth__side .mk-block h6,
.mk-t-split .mk-auth__side .mk-block a, .mk-t-split .mk-auth__side .mk-block p { color: #fff !important; }
