/* Зөвлөгөө авах dialog — resources/views/components/register-modal.blade.php
   Theme (style.css, bootstrap, uikit)-тэй давхцахгүйн тулд бүх class "rm-" угтвартай. */

.rm-root {
    --rm-bg: #F4F4F1;
    --rm-ink: #0B0B0F;
    --rm-muted: #5A5A63;
    --rm-blue: #3B5BFF;
    --rm-lime: #D7F25C;
    --rm-red: #D63A2F;
    --rm-white: #FFFFFF;
    --rm-line: rgba(11, 11, 15, .15);

    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    font-family: inherit;
    color: var(--rm-ink);
}
.rm-root[hidden] { display: none; }
.rm-root *, .rm-root *::before, .rm-root *::after { box-sizing: border-box; }

body.rm-lock { overflow: hidden; }

.rm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 11, 15, .55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.rm-dialog {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: auto;
    padding: 40px;
    background: var(--rm-bg);
    border-radius: 28px;
    box-shadow: 0 40px 100px -20px rgba(11, 11, 15, .45), 0 10px 30px rgba(11, 11, 15, .15);
    animation: rm-in .22s ease-out;
}
@keyframes rm-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.rm-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--rm-line);
    border-radius: 999px;
    background: var(--rm-white);
    color: var(--rm-ink);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.rm-close:hover { background: var(--rm-ink); color: var(--rm-white); }

/* Header */
.rm-logo { font-size: 18px; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 20px; }
.rm-logo span { color: var(--rm-lime); -webkit-text-stroke: .5px var(--rm-ink); }
.rm-root .rm-title {
    margin: 0 0 8px;
    padding-right: 48px;
    font-size: 32px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--rm-ink);
}
.rm-root .rm-subtitle { margin: 0; font-size: 15px; line-height: 1.5; color: var(--rm-muted); }
.rm-header { margin-bottom: 28px; }

/* Labels & inputs */
.rm-fieldset { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.rm-root .rm-label {
    display: block;
    margin: 0 0 8px;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--rm-ink);
    float: none;
    width: auto;
}
.rm-root .rm-input {
    display: block;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 16px;
    font: inherit;
    font-size: 16px; /* iOS zoom-оос сэргийлнэ */
    color: var(--rm-ink);
    background: var(--rm-white);
    border: 1px solid var(--rm-line);
    border-radius: 14px;
    box-shadow: none;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.rm-root .rm-input::placeholder { color: #9A9AA2; }
.rm-root .rm-input:focus { border-color: var(--rm-blue); box-shadow: 0 0 0 3px rgba(59, 91, 255, .15); }
.rm-root .rm-input.is-invalid { border-color: var(--rm-red); }
.rm-root .rm-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(214, 58, 47, .15); }

.rm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.rm-row--child { grid-template-columns: 1fr 120px; margin-bottom: 0; }
.rm-field { min-width: 0; }

.rm-root .rm-error { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--rm-red); }
.rm-root .rm-error:empty { display: none; }
.rm-root .rm-error--form { text-align: center; margin-top: 12px; }

/* Program option cards */
.rm-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rm-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 44px;
    margin: 0;
    padding: 16px;
    background: var(--rm-white);
    border: 1px solid var(--rm-line);
    border-radius: 18px;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.rm-option:hover { border-color: rgba(11, 11, 15, .35); }
.rm-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.rm-dot {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border: 1.5px solid var(--rm-line);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    color: var(--rm-ink);
}
.rm-option-text { display: flex; flex-direction: column; gap: 4px; }
.rm-option-title { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; color: var(--rm-ink); }
.rm-option-sub { font-size: 13px; line-height: 1.4; color: var(--rm-muted); }

.rm-option:has(input:checked) { background: var(--rm-ink); border-color: var(--rm-ink); }
.rm-option:has(input:checked) .rm-option-title { color: var(--rm-white); }
.rm-option:has(input:checked) .rm-option-sub { color: rgba(255, 255, 255, .7); }
.rm-option:has(input:checked) .rm-dot { background: var(--rm-lime); border-color: var(--rm-lime); }
.rm-option:has(input:checked) .rm-dot::after { content: "✓"; }
.rm-option:has(input:focus-visible) { outline: 3px solid rgba(59, 91, 255, .5); outline-offset: 2px; }
.rm-options.is-invalid .rm-option:not(:has(input:checked)) { border-color: var(--rm-red); }

/* Optional child box */
.rm-box { margin-bottom: 24px; padding: 20px; background: var(--rm-white); border-radius: 20px; }
.rm-box-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.rm-box-title { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.rm-badge {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--rm-muted);
    background: #EAEAE6;
    border-radius: 999px;
}
.rm-box .rm-input { background: var(--rm-bg); }

/* Buttons */
.rm-submit, .rm-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    padding: 0 28px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
/* Header-ийн "Зөвлөгөө" товчтой (theme-ийн .edu-btn) ижил өнгө */
.rm-submit {
    width: 100%;
    color: var(--rm-white);
    background: var(--color-primary, #1ab69d);
    border: 0;
}
.rm-submit:hover:not(:disabled) { background: linear-gradient(-90deg, #31b978 0%, #1ab69d 100%); }
.rm-submit:disabled { opacity: .6; cursor: progress; }
.rm-outline { color: var(--rm-ink); background: transparent; border: 1.5px solid var(--rm-ink); }
.rm-outline:hover { background: var(--rm-ink); color: var(--rm-white); }
.rm-submit:focus-visible, .rm-outline:focus-visible, .rm-close:focus-visible {
    outline: 3px solid rgba(59, 91, 255, .5);
    outline-offset: 2px;
}

.rm-root .rm-note { margin: 12px 0 0; text-align: center; font-size: 13px; color: var(--rm-muted); }

/* Success */
.rm-success { padding: 24px 0 8px; text-align: center; }
.rm-success[hidden] { display: none; }
.rm-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    font-size: 28px;
    font-weight: 800;
    background: var(--rm-lime);
    border-radius: 999px;
}
.rm-success .rm-title { padding: 0; outline: none; }
.rm-success .rm-subtitle { max-width: 440px; margin: 0 auto 28px; }
.rm-success .rm-subtitle strong { color: var(--rm-ink); }

/* Mobile */
@media (max-width: 600px) {
    .rm-root { padding: 12px; align-items: flex-start; }
    .rm-dialog { padding: 24px; border-radius: 24px; }
    .rm-close { top: 14px; right: 14px; }
    .rm-root .rm-title { font-size: 26px; }
    .rm-options, .rm-row { grid-template-columns: 1fr; }
    .rm-row--child { grid-template-columns: 1fr 120px; }
}

@media (prefers-reduced-motion: reduce) {
    .rm-dialog { animation: none; }
}