@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Playfair+Display:ital,wght@0,600;0,700;1,600;1,700&display=swap');

:root {
    --cr-bg-color: #10231f;
    --cr-text: #f5f1e8;
    --mg-ink: #10231f;
    --mg-ink-soft: #1b332d;
    --mg-paper: #f5f1e8;
    --mg-paper-deep: #ebe4d7;
    --mg-lime: #c9f15a;
    --mg-lime-hover: #dcff7b;
    --mg-coral: #ef6f51;
    --mg-muted: #9eb2aa;
    --mg-line-dark: rgba(16, 35, 31, .18);
    --mg-line-light: rgba(245, 241, 232, .18);
}

html {
    min-height: 100%;
    color-scheme: light;
    background: var(--mg-paper);
}

body {
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    color: var(--mg-ink);
    background:
        radial-gradient(circle at 12% 28%, rgba(239, 111, 81, .10) 0 4px, transparent 5px),
        radial-gradient(circle at 18% 66%, rgba(201, 241, 90, .25) 0 5px, transparent 6px),
        var(--mg-paper);
    font-family: "DM Sans", Arial, sans-serif;
}

body::before {
    content: '';
    position: fixed;
    z-index: 0;
    left: -210px;
    top: 120px;
    width: 620px;
    height: 620px;
    border: 1px solid rgba(16, 35, 31, .09);
    border-radius: 50%;
    background: transparent;
    box-shadow:
        0 0 0 82px rgba(16, 35, 31, .035),
        0 0 0 165px rgba(16, 35, 31, .025);
    pointer-events: none;
}

.cr-home {
    position: fixed;
    z-index: 20;
    top: 30px;
    left: clamp(22px, 4.6vw, 66px);
    min-width: 150px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    border: 0;
    border-radius: 0;
    color: var(--mg-ink);
    background: transparent;
    backdrop-filter: none;
    text-decoration: none;
    font: 700 21px/1 "DM Sans", Arial, sans-serif;
    letter-spacing: -1px;
}

.cr-home img { display: none; }

.cr-home::before {
    content: 'M';
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: var(--mg-lime);
    background: var(--mg-ink);
    font: italic 600 17px/1 "Playfair Display", serif;
}

.cr-home::after { content: 'Menglobe'; }
.cr-home:hover { color: var(--mg-coral); background: transparent; border: 0; }
.cr-home:active { transform: translateY(1px); }
.cr-home:focus-visible { outline: 2px solid var(--mg-coral); outline-offset: 6px; }

.cr-page {
    position: relative;
    z-index: 1;
    width: min(100%, 1440px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 104px clamp(22px, 4.6vw, 66px) 70px;
    display: grid;
    place-items: start center;
}

.cr-card {
    width: min(1180px, 100%);
    padding: 0;
    display: grid;
    grid-template-columns: minmax(300px, .74fr) minmax(520px, 1.26fr);
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--mg-line-dark);
    border-radius: 0;
    background: transparent;
    box-shadow: 22px 24px 0 rgba(16, 35, 31, .10);
    backdrop-filter: none;
}

.cr-title {
    position: relative;
    min-height: 100%;
    margin: 0;
    padding: 74px 52px 280px;
    display: block;
    overflow: hidden;
    color: transparent;
    background: var(--mg-paper-deep);
    border-right: 1px solid var(--mg-line-dark);
    font-size: 0;
}

.cr-title::before {
    content: 'Configura\A tu sala.';
    position: relative;
    z-index: 2;
    display: block;
    max-width: 360px;
    white-space: pre-line;
    color: var(--mg-ink);
    font: 600 clamp(48px, 4.5vw, 70px)/.94 "DM Sans", Arial, sans-serif;
    letter-spacing: -.07em;
}

.cr-title::after {
    content: 'ELIGE CÓMO QUIERES CONECTAR';
    position: absolute;
    z-index: 2;
    left: 52px;
    top: 42px;
    padding-left: 16px;
    color: var(--mg-ink);
    font: 500 10px/1 "DM Mono", monospace;
    letter-spacing: .07em;
}

.cr-title {
    background-image:
        radial-gradient(circle at 50% 72%, var(--mg-ink) 0 64px, transparent 65px),
        radial-gradient(circle at 50% 72%, transparent 0 112px, rgba(16, 35, 31, .13) 113px 114px, transparent 115px),
        radial-gradient(circle at 50% 72%, transparent 0 170px, rgba(16, 35, 31, .10) 171px 172px, transparent 173px);
}

.cr-title > * { position: relative; z-index: 2; }

.cr-form {
    padding: 58px clamp(32px, 4vw, 64px) 62px;
    display: grid;
    gap: 22px;
    color: var(--mg-paper);
    background: var(--mg-ink);
}

.cr-form::before {
    content: '01 / DATOS DE LA SALA';
    margin-bottom: 2px;
    color: var(--mg-lime);
    font: 500 10px/1 "DM Mono", monospace;
    letter-spacing: .07em;
}

.cr-field { display: grid; gap: 9px; }

.cr-label {
    color: var(--mg-paper);
    font: 500 10px/1 "DM Mono", monospace;
    letter-spacing: .065em;
    text-transform: uppercase;
}

.cr-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid rgba(245, 241, 232, .22);
    border-radius: 0;
    outline: none;
    color: var(--mg-paper);
    background: var(--mg-ink-soft);
    font: 500 15px/1 "DM Sans", Arial, sans-serif;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.cr-input::placeholder { color: #80948c; }
.cr-input:hover { border-color: rgba(245, 241, 232, .38); }
.cr-input:focus {
    border-color: var(--mg-lime);
    background: #203a33;
    box-shadow: 0 0 0 3px rgba(201, 241, 90, .12);
}

.cr-input[readonly] {
    color: #b8c8c1;
    background: #152b26;
    font-family: "DM Mono", monospace;
    font-size: 11px;
}

.cr-input-wrap { position: relative; display: block; }
.cr-input-wrap .cr-input { padding-right: 126px; }

.cr-input-action {
    position: absolute;
    top: 6px;
    right: 6px;
    height: 40px;
    padding: 0 17px;
    border: 1px solid var(--mg-coral);
    border-radius: 0;
    color: var(--mg-paper);
    background: transparent;
    font: 500 10px/1 "DM Mono", monospace;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
}
.cr-input-action:hover { color: var(--mg-ink); border-color: var(--mg-coral); background: var(--mg-coral); }
.cr-input-action:focus-visible { outline: 2px solid var(--mg-coral); outline-offset: 2px; }

.cr-hint {
    margin: 0;
    color: var(--mg-muted);
    font: 400 11px/1.45 "DM Sans", Arial, sans-serif;
}

.cr-toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 2px;
}

.cr-toggle {
    min-height: 58px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--mg-line-light);
    border-radius: 0;
    color: var(--mg-paper);
    background: rgba(245, 241, 232, .035);
    cursor: pointer;
    user-select: none;
    transition: border-color 150ms ease, background 150ms ease, transform 120ms ease;
}
.cr-toggle:hover,
.cr-toggle:focus-within { border-color: var(--mg-lime); background: rgba(201, 241, 90, .06); }
.cr-toggle:active { transform: translateY(1px); }

.cr-toggle-text {
    color: var(--mg-paper);
    font: 600 14px/1 "DM Sans", Arial, sans-serif;
}

.cr-switch-wrap {
    position: relative;
    width: 48px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.cr-switch-wrap input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.cr-switch {
    position: relative;
    width: 48px;
    height: 26px;
    border: 1px solid rgba(245, 241, 232, .24);
    border-radius: 0;
    background: #30453f;
    transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.cr-switch::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 0;
    background: var(--mg-paper);
    box-shadow: none;
    transform: none;
    transition: left 150ms ease, background 150ms ease;
}
.cr-switch-wrap input:checked + .cr-switch {
    border-color: var(--mg-lime);
    background: var(--mg-lime);
    box-shadow: none;
}
.cr-switch-wrap input:checked + .cr-switch::after { left: 26px; background: var(--mg-ink); }
.cr-switch-wrap input:focus-visible + .cr-switch { box-shadow: 0 0 0 3px rgba(201, 241, 90, .23); }

.cr-preview-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}
.cr-actions { display: inline-flex; gap: 8px; justify-content: flex-end; }

.cr-copy {
    height: 52px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(245, 241, 232, .28);
    border-radius: 0;
    color: var(--mg-paper);
    background: transparent;
    font: 500 10px/1 "DM Mono", monospace;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
}
.cr-copy:hover { color: var(--mg-ink); border-color: var(--mg-paper); background: var(--mg-paper); }
.cr-copy:disabled { opacity: .42; cursor: not-allowed; }

.cr-qr-wrap {
    margin-top: 8px;
    padding: 18px;
    border: 1px solid var(--mg-line-light);
    border-radius: 0;
    background: rgba(245, 241, 232, .04);
}
.cr-qr {
    width: 180px;
    height: 180px;
    padding: 10px;
    border: 0;
    border-radius: 0;
    background: var(--mg-paper);
}
.cr-qr canvas,
.cr-qr img { border-radius: 0; }

.cr-submit {
    height: 56px;
    margin-top: 4px;
    border: 1px solid var(--mg-lime);
    border-radius: 0;
    color: var(--mg-ink);
    background: var(--mg-lime);
    font: 600 12px/1 "DM Sans", Arial, sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 150ms ease, transform 120ms ease, box-shadow 150ms ease;
}
.cr-submit::after { content: '  ↗'; font-size: 16px; }
.cr-submit:hover { filter: none; background: var(--mg-lime-hover); box-shadow: 8px 9px 0 rgba(0, 0, 0, .20); }
.cr-submit:active { transform: translateY(1px); }

.cr-error {
    margin: 0;
    padding: 12px 14px;
    border-left: 3px solid var(--mg-coral);
    color: #ffc1b5;
    background: rgba(239, 111, 81, .10);
    font-size: 12px;
}

@media (max-width: 920px) {
    .cr-card { grid-template-columns: 1fr; width: min(720px, 100%); }
    .cr-title {
        min-height: 330px;
        padding: 70px 42px 170px;
        border-right: 0;
        border-bottom: 1px solid var(--mg-line-dark);
        background-position: center;
    }
    .cr-title::after { left: 42px; top: 36px; }
    .cr-form { padding: 46px 42px 52px; }
}

@media (max-width: 560px) {
    body::before { display: none; }
    .cr-home { position: absolute; top: 22px; left: 22px; }
    .cr-page { padding: 82px 16px 38px; }
    .cr-card { box-shadow: 10px 12px 0 rgba(16, 35, 31, .10); }
    .cr-title { min-height: 270px; padding: 62px 24px 130px; }
    .cr-title::before { font-size: clamp(43px, 13vw, 58px); }
    .cr-title::after { left: 24px; top: 30px; }
    .cr-form { padding: 36px 22px 42px; gap: 20px; }
    .cr-toggle-grid { grid-template-columns: 1fr; }
    .cr-preview-row { grid-template-columns: 1fr; }
    .cr-actions { justify-content: stretch; }
    .cr-copy { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
