@charset "utf-8";

/* Import atmospheric serif for headings and crisp sans-serif for inputs */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Exo+2:wght@400;500;600&display=swap');

:root {
    /* Core Theme Palette */
    --mu-bg-deep: #07080b;
    --mu-bg-surface: #11131a;
    --mu-accent-blood: #d32f2f;
    --mu-accent-hover: #f44336;
    --mu-accent-glow: rgba(211, 47, 47, 0.4);
    --mu-text-bright: #e8e9f0;
    --mu-text-muted: #8b90a0;
    --mu-border-dark: rgba(255, 255, 255, 0.06);
    --mu-border-light: rgba(255, 255, 255, 0.12);
    --mu-font-heading: 'Cinzel', serif;
    --mu-font-body: 'Exo 2', sans-serif;
}

/* ----------------------------------
   1. The Modal Container
   ---------------------------------- */
.ui-modal-widget {
    width: 100%;
    max-width: 420px;
    margin: 50px auto;
    background-color: var(--mu-bg-surface);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(211, 47, 47, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    
    border: 1px solid var(--mu-border-dark);
    border-top: 2px solid var(--mu-accent-blood);
    border-radius: 4px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.9), 0 0 40px rgba(0, 0, 0, 0.6);
    padding: 35px 40px;
    font-family: var(--mu-font-body);
    color: var(--mu-text-bright);
    position: relative;
    box-sizing: border-box; /* Ensures padding doesn't break the width */
}

/* ----------------------------------
   2. Headers
   ---------------------------------- */
.ui-modal-widget h2 {
    font-family: var(--mu-font-heading);
    font-size: 26px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    color: #ffffff;
    margin: 0 0 30px 0;
    border: none;
    padding: 0;
    text-shadow: 0 2px 15px var(--mu-accent-glow);
}

/* ----------------------------------
   3. Inputs & Labels
   ---------------------------------- */
.ui-modal-widget .registration label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--mu-text-muted);
    margin-top: 15px;
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.ui-modal-widget .registration input[type="text"],
.ui-modal-widget .registration input[type="password"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--mu-border-light);
    border-radius: 3px;
    color: #ffffff;
    padding: 12px 15px;
    font-family: var(--mu-font-body);
    font-size: 14px;
    outline: none;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
}

/* Focus Animations */
.ui-modal-widget .registration input[type="text"]:focus,
.ui-modal-widget .registration input[type="password"]:focus {
    border-color: var(--mu-accent-blood);
    background: rgba(0, 0, 0, 0.7);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 0 12px rgba(211, 47, 47, 0.2);
}

/* ----------------------------------
   4. The Checkbox Row
   ---------------------------------- */
/* Targets your specific empty label & rules label */
.ui-modal-widget .registration label[for="rules"] { display: none; }

.ui-modal-widget .registration label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    margin-top: 25px;
    text-transform: none;
    letter-spacing: normal;
    font-size: 13px;
    color: var(--mu-text-muted);
    cursor: pointer;
}

.ui-modal-widget .registration input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--mu-accent-blood); /* Colors the default checkbox crimson */
}

#rules_dialog {
    color: var(--mu-text-bright);
    text-decoration: underline;
    text-decoration-color: var(--mu-accent-blood);
    text-underline-offset: 3px;
    margin-left: 4px;
    transition: color 0.2s ease;
}
#rules_dialog:hover { color: var(--mu-accent-hover); }

/* ----------------------------------
   5. The Register Button
   ---------------------------------- */
.ui-modal-widget .registration input[type="submit"] {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, var(--mu-accent-blood) 0%, #9a1b1b 100%);
    color: #ffffff;
    border: 1px solid #ff5252;
    border-radius: 3px;
    padding: 15px;
    font-family: var(--mu-font-heading);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--mu-accent-glow);
    margin-top: 25px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, filter 0.2s ease;
}

.ui-modal-widget .registration input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.6);
    filter: brightness(1.1);
}

.ui-modal-widget .registration input[type="submit"]:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(211, 47, 47, 0.4);
}

/* ----------------------------------
   6. Close Button
   ---------------------------------- */
.ui-modal-widget .close {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px; 
    position: absolute; 
    right: 15px; 
    top: 15px; 
    color: var(--mu-text-muted);
    font-size: 28px;
    line-height: 1;
    text-decoration: none;
    transition: transform 0.2s ease, color 0.2s ease;
}
.ui-modal-widget .close::before {
    content: "×";
    font-family: sans-serif;
}
.ui-modal-widget .close:hover {
    color: var(--mu-accent-blood);
    transform: rotate(90deg);
}

/* ----------------------------------
   4. Custom CSS-Only Checkbox
   ---------------------------------- */
.reg-checkbox-container {
    display: flex;
    align-items: center;
    margin-top: 25px;
    margin-bottom: 25px;
    cursor: pointer;
    position: relative;
    user-select: none;
}

/* Hide the default browser checkbox entirely */
.reg-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Create the custom dark box */
.reg-checkmark {
    height: 18px;
    width: 18px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--mu-border-light);
    border-radius: 2px;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
}

/* Checkmark indicator (hidden by default) */
.reg-checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Toggled State */
.reg-checkbox-container input:checked ~ .reg-checkmark {
    background-color: var(--mu-accent-blood);
    border-color: var(--mu-accent-blood);
    box-shadow: 0 0 10px var(--mu-accent-glow);
}

.reg-checkbox-container input:checked ~ .reg-checkmark:after {
    display: block;
}

.reg-checkbox-text {
    font-size: 12px;
    color: var(--mu-text-muted);
}
.reg-checkbox-text a {
    color: var(--mu-text-bright);
    text-decoration: underline;
    text-decoration-color: var(--mu-accent-blood);
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}
.reg-checkbox-text a:hover {
    color: var(--mu-accent-hover);
}

/* If a required input is empty or invalid, give it a subtle warning tint */
.ui-modal-widget .registration input:-moz-ui-invalid {
    box-shadow: inset 0 0 8px rgba(211, 47, 47, 0.2);
}

/* ----------------------------------
   7. Mobile Optimization
   ---------------------------------- */
@media screen and (max-width: 480px) {
    .ui-modal-widget {
        margin: 20px auto;       /* Reduces the top/bottom gap to keep it on screen */
        padding: 25px 20px;      /* Halves the side padding to give inputs more room */
        width: 92%;              /* Leaves a small, clean gap around the edges of the phone */
    }

    .ui-modal-widget h2 {
        font-size: 22px;         /* Scales down the header slightly */
        margin-bottom: 20px;
    }

    .ui-modal-widget .registration input[type="text"],
    .ui-modal-widget .registration input[type="password"] {
        padding: 10px 12px;      /* Tighter input padding for thumbs */
        font-size: 16px;         /* Prevents iOS Safari from auto-zooming when typing */
    }

    .ui-modal-widget .registration input[type="submit"] {
        padding: 12px;
        font-size: 14px;
        margin-top: 15px;
    }
}