/*** ESTILOS COMUNES ***/
/*** variables *******************************************************/
:root {
    --body-padding: 1rem;
    --general-padding: 1.8rem;
    --main-font: "Montserrat", sans-serif;
    --monospace-font: "GoogleSansCode", monospace;
    --font-size: 16px;
    --line-height: 1.4rem;
    --text-color: #444;
    --important-text-color: red;
    --error-text-color: red;
    --primary-bg-color: #e1f56e;
    --default-bg-color: white;
    --btn-padding: 0.32rem 0.64rem;
    --btn-font-size: 0.9rem;
    --btn-default-bg-color: #444;
    --btn-default-bg-hover-color: #e1f56e;
    --btn-default-text-color: #ccc;
    --btn-default-text-hover-color: #444;
    --btn-selectable-bg-color: #eee;
    --btn-selectable-text-color: #888;
    --btn-selected-bg-color: var(--btn-default-bg-color);
    --btn-selected-text-color: var(--btn-default-text-color);
    --btn-border-radius: 2rem;
    --input-border-color: #444;
    --input-placeholder-color: #ccc;
    --mobile-border-radius: 0.8rem;
}

/*** animaciones *******************************************************/
@keyframes fadeIn {
    0% { opacity: 0; visibility: hidden; }
    100% { opacity: 1; visibility: visible; }
}
@keyframes fadeOut {
    0% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}
@keyframes toRight {
    0% { transform: translateX(0); }
    40% { opacity: 1; }
    100% { transform: translateX(500px); opacity: 0; }
}
@keyframes toLeft {
    0% { transform: translateX(0); }
    40% { opacity: 1; }
    100% { transform: translateX(-500px); opacity: 0; }
}

/*** fuentes *********************************************************/
@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 100 900;
    src: url("../fonts/Montserrat/Montserrat-VariableFont_wght.ttf");
}
@font-face {
    font-family: "Montserrat";
    font-style: italic;
    font-weight: 100 900;
    src: url("../fonts/Montserrat/Montserrat-Italic-VariableFont_wght.ttf");
}
@font-face {
    font-family: "GoogleSansCode";
    font-style: normal;
    font-weight: 100 900;
    src: url("../fonts/Google_Sans_Code/GoogleSansCode-VariableFont_MONO_wght.ttf");
}
@font-face {
    font-family: "GoogleSansCode";
    font-style: italic;
    font-weight: 100 900;
    src: url("../fonts/Google_Sans_Code/GoogleSansCode-Italic-VariableFont_MONO_wght.ttf");
}

/*** scrollbar *****************************************************/
/* Firefox */
html {
    scrollbar-width: thin;
}
/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 0.4rem;
    height: 0.4rem;
}
::-webkit-scrollbar-thumb {
    background-color: darkgray;
    border-radius: 0.4rem;
}

/*** parte común ***************************************************/
* {
    -webkit-user-select: none; /* Safari (móvil y escritorio) */
    -moz-user-select: none;    /* Versiones antiguas de Firefox */
    -ms-user-select: none;     /* Internet Explorer 10 y 11 / Edge antiguo */
    user-select: none;         /* Estándar: Chrome, Edge moderno, Firefox moderno y Opera */
}
body,
input {
    font-family: var(--main-font);
    font-size: var(--font-size);
    line-height: var(--line-height);
    color: var(--text-color);
}
body {
    background-color: lightgray;
    display: flex;
    box-sizing: border-box;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    padding: var(--body-padding);
    overflow-x: hidden !important;
}
em {
    font-weight: bold;
}
.hidden {
    display: none !important;
}
.fade-in {
    animation: fadeIn 0.4s ease-in forwards !important;
}
.fade-out {
    animation: fadeOut 0.4s ease-out forwards !important;
}
.from-right {
    animation: toRight 0.4s linear reverse !important;
}
.to-right {
    animation: toRight 0.4s linear forwards !important;
}
.from-left {
    animation: toLeft 0.4s linear reverse !important;
}
.to-left {
    animation: toLeft 0.4s linear forwards !important;
}
button,
input {
    font-size: 1rem;
}
button,
input[type="submit"] {
    background-color: var(--btn-default-bg-color);
    color: var(--btn-default-text-color);
    font-family: var(--main-font);
    font-size: var(--btn-font-size);
    border-radius: var(--btn-border-radius);
    padding: var(--btn-padding);
    cursor: pointer;
    border: none;
    transition: opacity 0.4s ease, transform 0.05s ease-in;
}
button:active,
input[type="submit"]:active {
    transform: scale(1.04);
}
button[disabled] {
    pointer-events: none !important;
    cursor: not-allowed !important;
    opacity: 0.4 !important;
}
button.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 3.2rem;
    font-size: 1.16rem;
    font-weight: 500;
}
button.primary > img {
    height: 60%;
    object-fit: contain;
    filter: brightness(0) invert(0.8);
}
input {
    border: none;
    border-block-end: 1px solid var(--input-border-color);
}
input::placeholder {
    color: var(--input-placeholder-color);
}
/* Para dispositivos con ratón o trackpad */
@media (pointer: fine) {
    button:hover,
    input[type="submit"]:hover {
        background-color: var(--btn-default-bg-hover-color);
        color: var(--btn-default-text-hover-color);
        transform: scale(1.04);
    }
    button.primary:hover > img {
        filter: brightness(1) invert(0.24);
    }
}
footer {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 1) 1.6rem);
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 0.4rem;
    box-sizing: border-box;
    padding: var(--general-padding) 0 var(--general-padding) 0;
    z-index: 10;
}
footer > button.primary {
    width: 100%;
}

/*** mobile container **********************************************/
div.mobile-container {
    background-color: var(--default-bg-color);
    display: flex;
    box-sizing: border-box;
    flex-direction: column;
    min-width: 520px;
    width: 28%;
    border-radius: var(--mobile-border-radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    overflow: hidden;
    position: relative;
    flex: 1;
}
div.mobile-container > header {
    background-color: var(--primary-bg-color);
    height: 3.2rem;
    display: flex;
    flex-direction: row;
    justify-content: left;
    box-sizing: border-box;
    padding: 1rem var(--general-padding);
}
div.mobile-container > header > img {
    height: 100%;
}
div.mobile-container > main {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}
div.mobile-container > main > * {
    position: absolute;
    inset: 0;
    padding: var(--general-padding) var(--general-padding) 0 var(--general-padding);
    bottom: 0;
    display: none;
    flex-direction: column;
}
div.mobile-container > main > .active {
    display: flex;
}

/*** versión vertical *******************************************/
@media only screen and (orientation: portrait) {
    body {
        padding: 0;
    }
    div.mobile-container {
        min-width: inherit;
        width: 100%;
        border-radius: inherit;
        box-shadow: none;
    }
}

/*** portada / splash scene ************************************/
#splash-scene {
    background: linear-gradient(0deg, #d2df00, var(--primary-bg-color));
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    animation: fadeOut 1.4s ease-out 4s forwards;
}
#splash-scene > section {
    text-align: center;
    animation: fadeIn 2s ease-in forwards;
    pointer-events: none;
}
#splash-scene > section > img {
    font-size: 4rem;
    line-height: 4rem;
    width: 220px;
    z-index: 51;
}

/*** sections group ******************************************/
div.sections-group {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1.6rem;
}
div.sections-group > section {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
div.sections-group > section > h2 {
    font-size: 1.46rem;
    font-weight: bold;
    line-height: 1.6rem;
    letter-spacing: -0.036em;
    margin: 0.6rem 0 1rem 0;
}
div.sections-group > section > h3 {
    font-size: 1.16rem;
    font-weight: bold;
    line-height: 1.28rem;
    letter-spacing: -0.03em;
    margin: 0.4rem 0;
}
div.sections-group > section > p {
    margin: 0.4rem 0;
}
div.sections-group > section > div > p {
    font-size: 0.84rem;
}

/*** options group ******************************************/
.options-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.options-group input[type="radio"],
.options-group input[type="checkbox"] {
    display: none;
}
.options-group label {
    background-color: var(--btn-selectable-bg-color);
    color: var(--btn-selectable-text-color);
    font-size: var(--btn-font-size);
    border-radius: var(--btn-border-radius);
    padding: var(--btn-padding);
    cursor: pointer;
    user-select: none;
    min-width: 1.6rem;
    line-height: 1.1rem;
    text-align: center;
    transition: transform 0.1s ease-in;
}
.options-group input[type="radio"]:checked + label,
.options-group input[type="checkbox"]:checked + label {
    background-color: var(--btn-selected-bg-color);
    color: var(--btn-selected-text-color);
}
/*input[type="radio"]:user-invalid ~ label {
    color: var(--error-text-color);
}*/
.options-group label:active { transform: scale(1.08); }
/* Para dispositivos con ratón o trackpad */
@media (pointer: fine) {
    .options-group label:hover { transform: scale(1.08); }
}
