
html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    position: fixed;
    overflow: hidden;
} /* This is to remove the default margin and padding of the body */

body {
    min-height: 100vh;   
    display: flex;
    flex-direction: column;
    transition: background-image 0.5s ease-in-out; /* Transición suave para el cambio de fondo */
    font-family: system-ui, Arial, sans-serif;
}

.background {
    position: absolute; /* Posiciona la imagen en el fondo */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1; /* Asegura que esté detrás de otros elementos */
    opacity: 0; /* Comienza invisible */
    transition: opacity 0.5s ease-in-out; /* Transición suave para la opacidad */
}

.background.show {
    opacity: 1; /* Muestra la imagen cuando se añade la clase 'show' */
}

.header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 20px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    width: 50px;
    height: 50px;
    margin-right: 10px;
    cursor: pointer;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo img:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8)) 
            drop-shadow(0 0 30px rgba(100, 200, 255, 0.6))
            drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

.logo-title {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: text-shadow 0.3s ease;
}

.logo:hover .logo-title {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6),
                 0 0 20px rgba(100, 200, 255, 0.4),
                 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 6px;
}

.links a {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    margin-left: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    transition: text-shadow 0.3s ease, transform 0.3s ease;
}

.links a:hover {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5),
                 0 0 15px rgba(100, 200, 255, 0.3),
                 1px 1px 3px rgba(0, 0, 0, 0.5);
    transform: scale(1.05);
}

.content {
    flex: 1 1 auto;
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto; /* The body does not scroll: long panels scroll here */
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    align-items: center;
    text-align: center;
    /*height: 67vh;*/
    /* Padding instead of margin so the scroll area reaches the footer */
    padding-bottom: 9%;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

/* Hero texts on a backing that follows the background brightness (contrast does not depend on the image) */
/* The content area scrolls: its children must keep their height instead of shrinking (the panels with
   overflow: hidden, like the QR options, were cut when the page did not fit) */
.content > * {
    flex-shrink: 0;
}

.hero {
    margin: 10px 16px 30px;
    padding: 10px 24px 14px;
    border-radius: 12px;
}

.hero .hero-title {
    font-size: 36px;
    color: #fff;
    margin: 0 0 10px;
}

.hero .hero-subtitle {
    font-size: 18px;
    color: #fff;
    margin: 0;
}

.url-input {
    position: relative;
    width: 50%;
    max-width: 600px;
    margin: 0px 0px 0px 0px;
}

#url-short-input {
    box-sizing: border-box;
    width: 100%;
    padding: 10px;
    /* Room for the "Shorten" button laid over the right end: the text never runs under it */
    padding-right: 80px;
    text-overflow: ellipsis;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#btn-shorten {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 8px;
    border: none;
    background-color: #2e7d32;
    color: white;
    cursor: pointer;
    border-radius: 3px;
    z-index: 10;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

#btn-shorten:disabled {
    background-color: #9E9E9E;
    cursor: not-allowed;
    opacity: 0.6;
}

#btn-shorten:hover:not(:disabled) {
    background-color: #1b5e20;
}

/* Loading spinner for shorten button */
.loading-spinner {
    display: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #333333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Done text after successful operation */
.done-text {
    display: none;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #2e7d32;
    font-weight: 600;
    font-size: 14px;
    z-index: 10;
}

#result {
    /*margin-top: 28px;*/
    color: #fff;
}

#qr-code {
    margin-top: 20px;
}

.options {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 15px;
    padding: 6px 14px;
    border-radius: 10px;
    /* Its backdrop-filter makes it a stacking context: lift it so the calendar opens above the panels below */
    position: relative;
    z-index: 2;
}

.options label {
    cursor: pointer;
}

.options input[type="checkbox"] {
    cursor: pointer;
}

.option-label {
    font-weight: 600;
    color: #fff; /* Default color, will be overridden by adaptive classes */
    cursor: pointer;
}

#expiration-date {
    color: #000;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 8px;
    cursor: text;
}

.qr-options {
    box-sizing: border-box;
    width: 72%;
    max-width: 450px;
    min-height: 210px;
    margin: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 7px 20px 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .qr-options {        
        min-height: 210px;   
    }

    .url-input {
        display: flex;;
        flex-direction: column;
        align-items: stretch;
        width: 72%;        
    }
    
    .content {
        padding-bottom: 42%;
    }
}
  
.qr-options .option.checkbox-right {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qr-options .option.checkbox-right label {
    order: -1; /* Mueve la etiqueta al inicio */
}

.qr-options .option.checkbox-right input[type="checkbox"] {
    margin-left: 10px; /* Añade un poco de espacio entre la etiqueta y el checkbox */
}

.qr-options h2 {
    font-size: 1.17em;
    color: #333; /* Color del título */
    margin-bottom: 15px; /* Espacio inferior */
}

.option {
    display: flex; /* Flexbox para alinear elementos */
    justify-content: space-between; /* Espacio entre elementos */
    align-items: center; /* Centrar verticalmente */
    margin-bottom: 15px; /* Espacio inferior entre opciones */
}

.option label {
    font-size: 14px;
}

#qr-color {
    border: none; /* Sin borde */
    width: 50px; /* Ancho fijo para el selector de color */
}

#qr-image-type {
    appearance: none; /* Elimina el estilo por defecto */
    -webkit-appearance: none;
    -moz-appearance: none;
    
    width: 43%;
    padding: 7px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    
    font-size: 16px;
    color: #333;
    
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M1 4 L6 9 L11 4' fill='none' stroke='%23888' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    
    transition: all 0.3s ease;
    cursor: pointer;
    outline: none;
}

#qr-image-type:hover {
    border-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#qr-image-type:focus {
    border-color: rgba(0, 123, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

#qr-image-file {
    display: none; /* Shown by the central image select */
}

#qr-image-url {
    display: none; /* Shown by the central image select */
    width: 95%; /* Ancho completo */
    padding: 10px; /* Espaciado interno */
    background-color: rgba(255, 255, 255, 0.9); /* Fondo blanco semi-transparente */
    border: 1px solid rgba(0, 0, 0, 0.2); /* Borde sutil */
    border-radius: 5px; /* Bordes redondeados */
    
    font-size: 16px; /* Tamaño de fuente */
    color: #333; /* Color del texto */
    
    transition: all 0.3s ease; /* Transición suave */
    outline: none; /* Sin contorno por defecto */
}

#qr-image-url::placeholder {
    color: rgba(0, 0, 0, 0.5); /* Color del texto del placeholder */
    opacity: 1; /* Asegura que el placeholder sea visible */
}

#qr-image-url:hover {
    border-color: rgba(0, 0, 0, 0.4); /* Cambia el borde al pasar el mouse */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Sombra suave al pasar el mouse */
}

#qr-image-url:focus {
    border-color: rgba(0, 123, 255, 0.5); /* Cambia el color del borde al enfocar */
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2); /* Sombra al enfocar */
}

/* Estilos del switch (checkbox) */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 18px;
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
  }
  
  /* Cambio de color cuando está activado */
  input:checked + .slider {
    background-color: #3498db; /* Azul claro */
  }
  
  input:checked + .slider:before {
    transform: translateX(18px);
  }
  
  /* Efecto de focus */
  input:focus + .slider {
    box-shadow: 0 0 1px #3498db; /* Azul claro */
  }

  .option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }
  
  .option-text {
    font-size: 14px;
    /*color: #333;*/
  }

  #result-container {
    display: none; /* Shown when there is a result */
  }

  .container {
    background-color: rgba(255, 255, 255, 0.3);
    margin-top: 20px;
    border-radius: 10px;
    padding: 20px 20px 20px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.3s ease;
  }


  .footer {
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 5px 0; /* the links are 24 px tall themselves */
    width: 100%;
    position: sticky;
    bottom: 0;
    z-index: 3; /* above the options row and its calendar while scrolling */
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.footer a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #ddd;
}

.footer span {
    color: #fff;
}

.shadow {
    font-size: 48px; /* Ajusta el tamaño de fuente según sea necesario */
    color: #333; /* Color del texto */
    text-align: center; /* Centra el texto */
    text-shadow: 
        3px 3px 0 rgba(0, 0, 0, 0.3), /* Sombra derecha e inferior más gruesa */
        -1px -1px 0 rgba(255, 255, 255, 0.7), /* Sombra izquierda y superior más gruesa */
        1px -1px 0 rgba(255, 255, 255, 0.7), /* Sombra derecha y superior más gruesa */
        -1px 1px 0 rgba(255, 255, 255, 0.7), /* Sombra izquierda e inferior más gruesa */
        1px 1px 0 rgba(255, 255, 255, 0.7); /* Sombra derecha e inferior más gruesa */
}

.shadow-minor {
    font-size: 48px; /* Ajusta el tamaño de fuente según sea necesario */
    color: #333; /* Color del texto */
    text-align: center; /* Centra el texto */
    text-shadow: 
        1px 1px 0 rgba(0, 0, 0, 0.3), /* Sombra derecha e inferior más gruesa */
        -1px -1px 0 rgba(255, 255, 255, 0.7), /* Sombra izquierda y superior más gruesa */
        1px -1px 0 rgba(255, 255, 255, 0.7), /* Sombra derecha y superior más gruesa */
        -1px 1px 0 rgba(255, 255, 255, 0.7), /* Sombra izquierda e inferior más gruesa */
        1px 1px 0 rgba(255, 255, 255, 0.7); /* Sombra derecha e inferior más gruesa */
}

/* Clases para texto adaptativo según el fondo */
.adaptive-text {
    transition: color 0.5s ease-in-out, text-shadow 0.5s ease-in-out;
}

.text-light {
    color: #fff !important;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        -1px -1px 2px rgba(0, 0, 0, 0.5) !important;
}

.text-dark {
    color: #1a1a1a !important;
    text-shadow: 
        1px 1px 2px rgba(255, 255, 255, 0.8),
        -1px -1px 2px rgba(255, 255, 255, 0.5) !important;
}

/* ---------------------------------------------------------------------------------
   No inline styles: the Content-Security-Policy does not allow them (style-src 'self').
   Elements toggled with the "hidden" attribute must stay hidden whatever their display.
   --------------------------------------------------------------------------------- */
[hidden] {
    display: none !important;
}

.footer-strong {
    font-weight: 800;
}

.result-expires {
    margin-top: 10px;
    font-weight: bold;
}

.expires-value {
    color: black;
}

.qr-image {
    border: 1px solid black;
    padding: 3px;
    width: 150px;
}

.copy-tooltip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 1000;
}

/* Messages */
.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 16px 20px;
    padding: 10px 14px;
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.notice-close {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.error-message {
    margin-top: 12px;
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.9);
    color: crimson;
    font-weight: bold;
    border-radius: 6px;
}

.warning-text {
    max-width: 420px;
    margin: 12px auto 0;
    padding: 6px 10px;
    background-color: #fff3cd;
    color: #8a5300;
    border-radius: 6px;
    font-size: 14px;
}

/* Buttons */
.btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* #2e7d32: white text 5.1:1 (WCAG AA); the former #4caf50 was 2.8:1 */
.btn-primary {
    background-color: #2e7d32;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #1b5e20;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #d0d0d0;
}

.btn-danger {
    background-color: #c9302c;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #a52824;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-apply-qr {
    width: 100%;
    margin-top: 10px;
}

/* Management of the current short link */
.link-panel {
    max-width: 420px;
    margin: 15px auto 0;
    padding: 12px 14px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border-radius: 8px;
    font-size: 14px;
    text-align: left;
}

.link-panel p {
    margin: 0 0 8px;
    font-size: 14px;
    color: #333;
}

.link-details {
    overflow-wrap: anywhere;
}

.key-box {
    margin: 10px 0;
    padding: 10px;
    background-color: #fff3cd;
    border: 1px solid #ffecb5;
    border-radius: 6px;
}

.key-box .key-warning {
    color: #664d03;
    font-weight: 600;
}

.key-hint {
    margin: 8px 0 0;
    color: #664d03;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.key-hint:empty {
    display: none;
}

.edit-key {
    display: block;
    padding: 6px 8px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 13px;
    word-break: break-all;
    user-select: all;
}

.link-actions {
    margin-top: 6px;
}

.date-input {
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.delete-confirm {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #c9302c;
    border-radius: 6px;
    text-align: center;
}

.action-message {
    margin-top: 8px;
    color: #2e7d32;
    font-weight: 600;
    text-align: center;
}

.action-message.is-error {
    color: crimson;
}

/* "Manage a link" (opened from the header link, ?manage= or a key file) */
.manage-section {
    box-sizing: border-box;
    width: 72%;
    max-width: 450px;
    margin-top: 20px;
    padding: 4px 20px 20px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.manage-section form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Title of a closable panel with its "×" button */
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.panel-head h2 {
    margin: 0.6em 0;
    font-size: 1.17em;
}

.panel-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #555;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.panel-close:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

/* Focused by the page after opening a link from "Manage a link" (tabindex="-1", not reachable with Tab) */
#result-container:focus {
    outline: none;
}

.text-input {
    box-sizing: border-box;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    font-size: 15px;
}

.key-input-row {
    display: flex;
    gap: 8px;
}

/* 16 px on phones: Safari on iPhone zooms the page into any field with a smaller text */
@media (max-width: 768px) {
    .text-input {
        font-size: 16px;
    }
}

.manage-message {
    color: crimson;
    font-weight: 600;
    font-size: 14px;
}

.manage-message:empty {
    display: none;
}

/* ---------------------------------------------------------------------------------
   1.2.0: accessibility, backings, sharing, QR downloads, statistics, session links,
   cookie banner and legal pages.
   --------------------------------------------------------------------------------- */

/* Text only for screen readers */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Visible keyboard focus everywhere */
:focus-visible {
    outline: 3px solid #3987e5;
    outline-offset: 2px;
}

/* Backings behind the texts on the background image (dark until the image is analysed) */
.hero,
.options,
.demo-link-row {
    background-color: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
}

body.bg-light .hero,
body.bg-light .options,
body.bg-light .demo-link-row {
    background-color: rgba(255, 255, 255, 0.6);
}

/* Dark base while the background image loads (the texts are white) */
body.page-app {
    background-color: #232c3d;
}

/* The footer is not adaptive: it always has its own dark backing */
.footer {
    background-color: rgba(20, 24, 32, 0.6);
}

body.page-app .container {
    background-color: rgba(0, 0, 0, 0.35);
}

body.bg-light.page-app .container {
    background-color: rgba(255, 255, 255, 0.6);
}

/* Header navigation */
.links a + a {
    margin-left: 20px;
}

.links a {
    margin-left: 0;
}

@media (max-width: 600px) {
    .header {
        padding: 12px 16px;
    }

    .logo-title {
        font-size: 20px;
    }

    .links a {
        font-size: 14px;
    }

    .links a + a {
        margin-left: 14px;
    }

    .hero .hero-title {
        font-size: 28px;
    }
}

/* Expiration date with quick choices */
.expiration-fields {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.presets {
    display: inline-flex;
    gap: 4px;
}

.btn-chip {
    padding: 3px 8px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 12px;
    cursor: pointer;
}

.btn-chip:hover {
    background-color: #fff;
}

/* QR options */
.color-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.color-value {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 13px;
    color: #333;
}

.logo-preview {
    display: block;
    max-width: 64px;
    max-height: 64px;
    margin: 8px auto 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
}

/* Result */
.short-url {
    user-select: all;
    overflow-wrap: anywhere;
}

#share-row {
    margin-top: 12px;
}

#qr-downloads {
    margin-top: 8px;
}

.key-saved {
    color: #2e7d32;
    font-weight: 700;
}

/* Spinner on the button of the action in progress */
.btn.is-busy::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 6px;
    vertical-align: -1px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin-inline 0.8s linear infinite;
}

@keyframes spin-inline {
    to { transform: rotate(360deg); }
}

/* Statistics */
.link-stats {
    margin-top: 10px;
    padding: 10px;
    background-color: #f5f6f5;
    border-radius: 6px;
}

.link-stats h4 {
    margin: 12px 0 6px;
    font-size: 13px;
    color: #333;
}

.stats-summary {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.stats-figure {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a19;
}

.stats-figure-label,
.stats-note {
    font-size: 13px;
    color: #555;
}

.link-panel .stats-note {
    margin: 4px 0 0;
}

.link-panel .stats-empty {
    margin: 8px 0 0;
    color: #555;
}

.link-panel .stats-empty.is-error {
    color: crimson;
}

.stats-chart {
    position: relative;
}

.stats-svg {
    display: block;
    width: 100%;
    height: auto;
}

.stats-bar {
    fill: #2a78d6;
}

.stats-hit {
    fill: transparent;
}

.stats-hit:hover {
    fill: rgba(42, 120, 214, 0.08);
}

.stats-grid,
.stats-baseline {
    stroke: #d9dad8;
    stroke-width: 1;
}

.stats-baseline {
    stroke: #b5b6b3;
}

.stats-axis-text,
.stats-peak {
    font-size: 9px;
    fill: #555;
    font-variant-numeric: tabular-nums;
}

.stats-peak {
    fill: #1a1a19;
    font-weight: 600;
}

.stats-tooltip {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    padding: 3px 8px;
    background-color: #1a1a19;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
}

.stats-table {
    margin-top: 6px;
    font-size: 13px;
}

.stats-table summary {
    cursor: pointer;
    color: #2a5fa8;
}

.stats-table table {
    width: 100%;
    margin-top: 6px;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.stats-table th,
.stats-table td {
    padding: 2px 6px;
    border-bottom: 1px solid #e3e4e2;
    text-align: left;
}

.stats-rankings {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.stats-ranking ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.stats-ranking li {
    display: grid;
    grid-template-columns: minmax(0, 9em) 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    font-size: 13px;
}

.stats-ranking-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-ranking-track {
    height: 10px;
}

.stats-ranking-bar {
    display: block;
    height: 100%;
    background-color: #2a78d6;
    border-radius: 0 4px 4px 0;
}

.stats-ranking-value {
    font-variant-numeric: tabular-nums;
    color: #333;
}

.stats-notes {
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px solid #e3e4e2;
}

.link-panel .stats-notes p {
    margin: 2px 0;
    color: #666;
    font-size: 11px;
}

.stats-notes a {
    color: #2a5fa8;
}

/* Links of this visit */
.session-links {
    box-sizing: border-box;
    width: 72%;
    max-width: 450px;
    margin-top: 20px;
    padding: 10px 16px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.session-links h2 {
    margin: 4px 0 8px;
    font-size: 15px;
}

.session-links ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.session-links li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-top: 1px solid #e3e4e2;
    font-size: 14px;
}

.session-links li.is-current {
    font-weight: 600;
}

.session-link-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.session-link-destination {
    overflow: hidden;
    color: #666;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-link-unsaved {
    color: #8a5300;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Manage a link */
.manage-section label {
    font-size: 13px;
    font-weight: 600;
}

.button-row-start {
    justify-content: flex-start;
    margin-top: 0;
}

.file-button {
    display: inline-block;
}

/* Footer links and cookie settings: 24 px tall touch targets (WCAG 2.2 target size), the two rows touched */
.footer-content a,
.footer-button {
    display: inline-block;
    padding: 3px 0;
    color: #fff;
    font-size: 14px;
    line-height: 18px;
}

.footer-button {
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.footer-content a {
    text-decoration: underline;
}

.footer-content a:has(b) {
    text-decoration: none;
}

/* Cookie banner: Accept and Reject with the same prominence */
.l4y-choices {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 1000;
    max-width: 520px;
    margin: 0 auto;
    padding: 14px 18px;
    background-color: #fff;
    color: #333;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    font-size: 14px;
    text-align: left;
}

.l4y-choices p {
    margin: 0 0 8px;
}

.l4y-choices-title {
    font-weight: 700;
}

.l4y-choices a {
    color: #2a5fa8;
}

.btn-choice {
    min-width: 110px;
    background-color: #232c3d;
    color: #fff;
}

.btn-choice:hover:not(:disabled) {
    background-color: #36425a;
}

/* Legal pages */
body.page-doc {
    background: linear-gradient(160deg, #232c3d 0%, #3d5560 55%, #b1c0b9 100%);
}

.doc {
    box-sizing: border-box;
    width: 92%;
    max-width: 760px;
    margin: 10px 0 30px;
    padding: 20px 28px;
    background-color: #fff;
    color: #222;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    text-align: left;
    line-height: 1.55;
}

.doc h1 {
    margin-top: 0;
    font-size: 28px;
}

.doc h2 {
    margin-top: 24px;
    font-size: 19px;
}

.doc a {
    color: #2a5fa8;
}

.doc-updated {
    color: #666;
    font-size: 14px;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.doc-table th,
.doc-table td {
    padding: 6px 8px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

body.page-doc .content {
    justify-content: flex-start;
}

/* Respect "reduce motion": no fades, slides or spinning */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Report abuse */
.report-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 16px 0;
}

.report-form label {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
}

/* The submit button of the forms (abuse report, password): clear of the field above it */
.report-form .button-row {
    margin-top: 10px;
}

.report-form .button-row .btn {
    padding: 9px 18px;
    font-size: 15px;
}

.report-form textarea {
    resize: vertical;
    font-family: inherit;
}

.report-message {
    font-weight: 600;
}

.report-message:empty {
    display: none;
}

.report-message.is-success {
    color: #2e7d32;
}

.report-message.is-error {
    color: crimson;
}

.report-fallback {
    margin: 0;
    font-size: 14px;
}

/* Field only bots fill (it is not hidden with display: none, which some bots detect) */
.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* "How does it work?": a discreet text link under the form that opens the demo video */
.demo-link-row {
    margin: 14px 0 0;
    padding: 3px 12px;
    border-radius: 10px;
    color: #fff; /* on the dark backing until the background is analysed (then .text-light/.text-dark) */
    font-size: 14px;
}

.link-button {
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.demo-section {
    box-sizing: border-box;
    width: 92%;
    max-width: 760px;
    margin-top: 12px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.demo-video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    background-color: #000;
}

/* More options (custom alias, click limit, password) */
.more-options {
    box-sizing: border-box;
    width: 72%;
    max-width: 450px;
    margin: 20px;
    padding: 7px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.more-options h2 {
    font-size: 1.17em;
    text-align: center;
}

.more-options label {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
}

.alias-field {
    display: flex;
    align-items: stretch;
}

.alias-prefix {
    display: flex;
    align-items: center;
    padding: 0 8px;
    background-color: #e9ecef;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-right: none;
    border-radius: 5px 0 0 5px;
    color: #555;
    font-size: 15px;
}

.alias-field .text-input {
    border-radius: 0 5px 5px 0;
}

.field-hint {
    color: #666;
    font-size: 12px;
}

.number-input {
    box-sizing: border-box;
    width: 9.5em;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Date picker (public/js/datepicker.js) */
.datepicker {
    position: relative;
    display: inline-flex;
    align-items: stretch;
}

.datepicker .date-input {
    width: 7.5em;
    border-radius: 4px 0 0 4px;
    font-variant-numeric: tabular-nums;
}

#expiration-date {
    border-radius: 4px 0 0 4px;
}

.datepicker-toggle {
    display: inline-flex;
    align-items: center;
    padding: 0 7px;
    border: 1px solid #ccc;
    border-left: none;
    border-radius: 0 4px 4px 0;
    background-color: #fff;
    color: #333;
    cursor: pointer;
}

.datepicker-toggle:hover {
    background-color: #f0f0f0;
}

.datepicker-popup {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 900;
    width: 252px;
    padding: 8px;
    background-color: #fff;
    color: #222;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    text-shadow: none;
    font-size: 13px;
    text-align: center;
}

.datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.datepicker-title {
    font-weight: 700;
}

.datepicker-nav,
.datepicker-today,
.datepicker-close {
    padding: 2px 9px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f7f7f7;
    color: #222;
    cursor: pointer;
}

.datepicker-nav:disabled,
.datepicker-today:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.datepicker-grid {
    width: 100%;
    border-collapse: collapse;
}

.datepicker-grid th {
    padding: 2px 0;
    color: #666;
    font-weight: 600;
}

.datepicker-grid td {
    padding: 1px;
}

.datepicker-day {
    width: 32px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: none;
    color: #222;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.datepicker-day:hover:not(:disabled) {
    background-color: #e8f0fb;
}

.datepicker-day.is-today {
    font-weight: 700;
    box-shadow: inset 0 0 0 1px #2a78d6;
}

.datepicker-day.is-selected {
    background-color: #2a78d6;
    color: #fff;
}

.datepicker-day:disabled {
    color: #bbb;
    cursor: not-allowed;
}

.datepicker-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

/* Password page */
.doc-narrow {
    max-width: 480px;
}

/* ---------------------------------------------------------------------------------
   Reveal effect shared by the option panels ("Generate a QR", "More options") and the
   expiration fields: fade + short slide, and the size grows to the real content size
   (grid 0fr -> 1fr, no max-height guess). Closed content is visibility: hidden, so it is
   out of the tab order and of the accessibility tree. Toggled with setRevealed() in app.js
   (classes is-open and, once the animation ends, is-settled).
   --------------------------------------------------------------------------------- */
.reveal {
    /* Containing block of the absolutely positioned elements inside (hidden labels, the "Open key file" input).
       Without it, once open (transform: none) they escaped the scroll area of .content and made the body taller */
    position: relative;
    --reveal-duration: 0.32s;
    display: grid;
    grid-template-rows: 0fr;
    align-self: stretch;
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    transition: grid-template-rows var(--reveal-duration) ease, opacity var(--reveal-duration) ease,
        transform var(--reveal-duration) ease, visibility 0s linear var(--reveal-duration);
}

.reveal.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: none; /* not translateY(0): an open panel must not create a stacking context */
    visibility: visible;
    transition-delay: 0s;
}

.reveal > .reveal-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    overflow: hidden;
}

/* Inline version (expiration fields inside the options row): grows sideways */
.reveal-inline {
    --reveal-duration: 0.32s;
    display: inline-grid;
    grid-template-columns: minmax(0, 0fr);
    /* Cancels the gap of the options row while closed */
    margin-left: -15px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-columns var(--reveal-duration) ease, opacity var(--reveal-duration) ease,
        margin-left var(--reveal-duration) ease, visibility 0s linear var(--reveal-duration);
}

.reveal-inline.is-open {
    grid-template-columns: minmax(0, 1fr);
    margin-left: 0;
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

/* The content keeps its natural width (it is clipped by the column, not squeezed): squeezed to 0 px it wrapped
   word by word and made the closed row taller than the open one */
.reveal-inline > .reveal-inner {
    width: max-content;
    max-width: calc(100vw - 28px);
    min-width: 0; /* lets the 0fr column collapse */
}

/* Once open, nothing is clipped (the calendar of the date picker overflows the row) */
.reveal-inline.is-settled {
    overflow: visible;
}
