* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: #f4f5f7;
    color: #1b1f24;
    display: flex;
    justify-content: center;
}

main {
    width: min(40rem, 92vw);
    margin-top: 12vh;
    background: #ffffff;
    border: 1px solid #d8dbe0;
    border-radius: 10px;
    padding: 2rem;
}

h1 {
    margin-top: 0;
    font-size: 1.5rem;
}

/* --- Sesión con Google (issue #19) --- */

#cuenta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.4rem;
    margin-bottom: 0.75rem;
}

#cuenta .button-link,
#cuenta button {
    margin-top: 0;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

#cuenta-usuario {
    color: #6a737d;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.field-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

#destination,
#namespace-input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid #b9bec7;
    border-radius: 6px;
    font-size: 1rem;
}

/* --- Elección del namespace (issue #20) --- */

#namespace {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #d8dbe0;
    border-radius: 6px;
    background: #f8f9fa;
}

#mi-namespace {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #d8dbe0;
    border-radius: 6px;
    background: #f8f9fa;
}

#mi-namespace li {
    margin: 0.75rem 0;
}

#mi-namespace li button {
    padding: 0.35rem 0.7rem;
    font-size: 0.9rem;
}

#namespace h2 {
    margin-top: 0;
    font-size: 1.15rem;
}

button {
    padding: 0.6rem 1.2rem;
    border: 0;
    border-radius: 6px;
    background: #2457c5;
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
}

button:hover {
    background: #1c45a0;
}

.error {
    color: #a2121f;
}

.notice {
    color: #6a737d;
    font-size: 0.9rem;
}

#result {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid #d8dbe0;
    border-radius: 6px;
    background: #f8f9fa;
    overflow-wrap: anywhere;
}

/* --- QR del enlace (issue #7) --- */

#qr-figure {
    margin: 1rem 0 0;
    text-align: center;
}

#qr-image {
    width: min(280px, 100%);
    height: auto;
    image-rendering: pixelated;
    border: 1px solid #d8dbe0;
    border-radius: 4px;
    background: #ffffff;
}

#qr-figure figcaption {
    margin-top: 0.4rem;
    color: #6a737d;
    font-size: 0.85rem;
}

/* --- Vinculación por QR (issue #22) --- */

#vinculacion {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #d8dbe0;
    border-radius: 6px;
    background: #f8f9fa;
}

#vinculacion h2 {
    margin-top: 0;
    font-size: 1.15rem;
}

#vinculacion-figura {
    margin: 1rem 0 0;
    text-align: center;
}

#vinculacion-qr {
    width: min(280px, 100%);
    height: auto;
    image-rendering: pixelated;
    border: 1px solid #d8dbe0;
    border-radius: 4px;
    background: #ffffff;
}

#vinculacion-estado {
    margin-bottom: 0;
}

/* El atributo `hidden` del HTML tiene que ganarle a cualquier `display`
   de clase: la web lo usa para alternar el acceso y el usuario. */
[hidden] {
    display: none !important;
}

.button-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    background: #2457c5;
    color: #ffffff;
    font-size: 1rem;
    text-decoration: none;
}

.button-link:hover {
    background: #1c45a0;
}
