/* Scoped to this plugin's pages and card; Moodle/theme forms elsewhere are unaffected. */
body.auth-emailotp-page .login-container {
    width: 580px;
    max-width: 100%;
    padding: 0;
    background: transparent;
    box-shadow: none;
}
body.auth-emailotp-page .login-wrapper {
    padding: 16px 0;
}
.auth-emailotp {
    --emailotp-blue: #146ac6;
    --emailotp-border: #d7e1ee;
    --emailotp-muted: #50617b;
    box-sizing: border-box;
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    padding: 32px;
    border: 1px solid var(--emailotp-border);
    border-radius: 24px;
    background: #fff;
    color: #111820;
    line-height: 1.6;
    text-align: start;
}
.auth-emailotp *, .auth-emailotp *::before, .auth-emailotp *::after { box-sizing: border-box; }
.auth-emailotp .emailotp-brand { display: flex; align-items: center; gap: 10px; color: var(--emailotp-muted); font-size: .9rem; }
.auth-emailotp .emailotp-progress { display: flex; gap: 7px; margin: 28px 0; }
.auth-emailotp .emailotp-progress span { flex: 1; height: 5px; border-radius: 8px; background: #f1f4f8; }
.auth-emailotp .emailotp-progress .is-active { background: var(--emailotp-blue); }
.auth-emailotp h1 { font-size: clamp(1.6rem, 4vw, 2rem); font-weight: 650; letter-spacing: -.025em; line-height: 1.25; margin: 0 0 16px; }
.auth-emailotp .emailotp-eyebrow { font-size: .8rem; letter-spacing: .07em; text-transform: uppercase; color: var(--emailotp-muted); margin-bottom: 18px; }
.auth-emailotp .emailotp-subtitle { color: var(--emailotp-muted); margin: 0 0 30px; font-size: 1.05rem; }
.auth-emailotp .mform { margin: 0; }
.auth-emailotp .mform .fitem { display: block; margin-left: 0; margin-right: 0; margin-bottom: 18px !important; }
.auth-emailotp .mform .fitem > .col-md-3,
.auth-emailotp .mform .fitem > .col-md-9 { width: 100%; max-width: 100%; flex: 0 0 100%; padding: 0; }
.auth-emailotp .mform .col-form-label { margin-bottom: 7px; font-weight: 400; }
.auth-emailotp .mform .femptylabel > .col-form-label { display: none !important; }
.auth-emailotp .mform input[type="text"],
.auth-emailotp .mform input[type="password"],
.auth-emailotp .mform input[type="email"],
.auth-emailotp .mform input[type="tel"],
.auth-emailotp .mform select { width: 100%; max-width: 100%; min-height: 54px; padding: 12px 14px; border: 1px solid var(--emailotp-border); border-radius: 12px; background-color: #fff; color: #172537; font-size: 1rem; }
.auth-emailotp .mform .form-control-static { color: var(--emailotp-muted); font-size: .875rem; overflow-wrap: anywhere; }
.auth-emailotp .btn { white-space: normal; font-family: inherit; }
.auth-emailotp .emailotp-primary { display: block; width: 100%; min-height: 54px; border: 1px solid var(--emailotp-blue); border-radius: 12px; padding: 13px 14px; background: var(--emailotp-blue); color: #fff; text-align: center; font-size: 1rem; text-decoration: none; }
.auth-emailotp .emailotp-primary:hover { background: #1059a8; border-color: #1059a8; }
.auth-emailotp .emailotp-secondary { display: block; width: 100%; min-height: 44px; background: none; color: #0864c2; border: 0; text-align: center; padding: 8px; }
.auth-emailotp a { color: #0864c2; }
.auth-emailotp :is(input, select, button, a, summary):focus-visible { outline: 3px solid #75ace7; outline-offset: 3px; box-shadow: none; }
.auth-emailotp [aria-disabled="true"] { opacity: .6; cursor: wait; }
.auth-emailotp[data-stage="choose"] .mform,
.auth-emailotp[data-stage="details"] .mform { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
.auth-emailotp[data-stage="details"] .mform > * { grid-column: 1 / -1; }
.auth-emailotp[data-stage="details"] #fitem_id_firstname,
.auth-emailotp[data-stage="details"] #fitem_id_lastname { grid-column: auto; }
.auth-emailotp .emailotp-channel { width: 100%; min-height: 72px; padding: 14px 12px 14px 44px; text-align: start; border: 1px solid var(--emailotp-border); border-radius: 14px; color: #172537; background-color: #fff; background-position: 15px center; background-repeat: no-repeat; background-size: 20px; }
.auth-emailotp .emailotp-channel:hover { border-color: var(--emailotp-blue); background-color: #f5f9fe; }
.auth-emailotp .emailotp-channel[data-channel="email"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23172537' stroke-width='1.5'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 6 9 7 9-7'/%3E%3C/svg%3E"); }
.auth-emailotp .emailotp-channel[data-channel="whatsapp"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23172537' stroke-width='1.5'%3E%3Cpath d='M21 11.5A9 9 0 0 1 7 19l-4 1 1-4A9 9 0 1 1 21 11.5Z'/%3E%3C/svg%3E"); }
.auth-emailotp .emailotp-channel[data-channel="sms"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23172537' stroke-width='1.5'%3E%3Crect x='6' y='2' width='12' height='20' rx='2'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E"); }
.auth-emailotp .emailotp-channel[data-channel="telegram"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23172537' stroke-width='1.5'%3E%3Cpath d='m3 10 18-7-6 18-4-8-8-3 18-7-10 10'/%3E%3C/svg%3E"); }
.auth-emailotp[data-stage="choose"] .mform > .fitem:nth-child(2):last-child { grid-column: 1 / -1; }
.auth-emailotp .emailotp-loginhint, .auth-emailotp .emailotp-timing { font-size: .875rem; color: var(--emailotp-muted); margin: 22px 0; }
.auth-emailotp .emailotp-timing { text-align: center; }
.auth-emailotp .emailotp-timing span { display: block; }
.auth-emailotp .emailotp-footer { border-top: 1px solid var(--emailotp-border); padding-top: 24px; margin-top: 26px; text-align: center; color: var(--emailotp-muted); }
.auth-emailotp .emailotp-footer a { display: inline-block; padding: 6px; }
.auth-emailotp .emailotp-resume-link, .auth-emailotp .emailotp-login-link { display: block !important; text-align: center; font-size: .875rem; padding: 8px; }
.auth-emailotp .emailotp-resume { margin-top: 24px; color: var(--emailotp-muted); font-size: .8rem; }
.auth-emailotp .emailotp-resume summary { padding: 10px 0; cursor: pointer; }
.auth-emailotp .emailotp-resume code { display: block; overflow-wrap: anywhere; margin: 12px 0; }
.auth-emailotp .mform input[name="code"] { font-size: 1.6rem; letter-spacing: .3em; text-align: center; min-height: 76px; }
.auth-emailotp .emailotp-badge { display: inline-block; padding: 10px 14px; border-radius: 10px; color: #087646; background: #f2f6fa; margin-bottom: 28px; font-size: .875rem; }
.auth-emailotp.emailotp-success { text-align: center; }
.auth-emailotp .emailotp-success-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: #f2f6fa; color: #087646; margin: 30px auto 24px; }
.auth-emailotp .emailotp-password-toggle { min-height: 44px; padding: 8px 0; background: none; border: 0; color: #0864c2; font-size: .875rem; }
.auth-emailotp .emailotp-username-label { margin-inline-end: .25em; }
.auth-emailotp .emailotp-error { overflow-wrap: anywhere; }
@media (max-width: 480px) {
    .auth-emailotp { padding: 24px 20px; border-radius: 18px; }
    .auth-emailotp[data-stage="choose"] .mform { grid-template-columns: 1fr; }
    .auth-emailotp[data-stage="details"] #fitem_id_firstname,
    .auth-emailotp[data-stage="details"] #fitem_id_lastname { grid-column: 1 / -1; }
    .auth-emailotp .emailotp-channel { min-height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-emailotp * { transition: none !important; }
}
