:root {
    --brand-color: #333333;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f4f9;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.5s ease;
}

/* Utilidades generales */
.loader-container {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--brand-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Tarjetas base (Instalación y Onboarding) */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 30px 20px;
    width: 85%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: none;
}

.logo-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

h1 {
    font-size: 24px;
    color: #111;
    margin-bottom: 8px;
}

p {
    color: #666;
    font-size: 15px;
    margin-bottom: 25px;
    line-height: 1.4;
}

/* Formularios y Botones Generales */
.input-group {
    margin-bottom: 12px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
}

.input-group input:focus {
    outline: none;
    border-color: var(--brand-color);
}

.btn-primary {
    background-color: var(--brand-color);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
    margin-top: 10px;
}

.btn-primary:active {
    transform: scale(0.96);
}

.btn-text {
    background: transparent;
    color: var(--brand-color);
    border: none;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    margin-top: 5px;
}

/* Mensaje iOS Mejorado */
.ios-instructions {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: left;
    border: 1px solid #eee;
    margin-top: 15px;
}

.ios-title {
    font-weight: 700;
    color: #111;
    font-size: 16px;
    margin-bottom: 12px;
    text-align: center;
}

.ios-step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #444;
    font-size: 14px;
}

.ios-step:last-child {
    margin-bottom: 0;
}

.ios-icon-wrapper {
    background: #f4f4f9;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ios-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

/* =========================================
   NUEVO DISEÑO APP (ESTADO 2B) PANTALLA COMPLETA
   ========================================= */
.app-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    background-color: #f8f9fa;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 50;
}

.app-header {
    width: 100%;
    height: 32vh;
    min-height: 240px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    flex-shrink: 0;
}

.app-info-card {
    width: 92%;
    max-width: 450px;
    background: white;
    border-radius: 20px;
    margin-top: -45px;
    padding: 0 20px 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    text-align: center;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    flex-shrink: 0;
}

.app-logo-box {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: white;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin: -45px auto 12px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-logo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-title {
    color: var(--brand-color);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1.2;
}

.brand-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 0;
}

.app-actions {
    width: 92%;
    max-width: 450px;
    margin-top: 20px;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

/* Botones de la App */
.btn-app-primary {
    background-color: var(--brand-color);
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.btn-app-primary:active {
    transform: scale(0.97);
}

.btn-app-primary .btn-icon {
    font-size: 22px;
    background: rgba(255, 255, 255, 0.2);
    min-width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-text-wrapper {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.btn-text-wrapper small {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.85;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.btn-text-wrapper span {
    display: block;
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
}

.btn-app-secondary {
    background-color: white;
    color: #444;
    border: none;
    padding: 16px 20px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    width: 100%;
    box-sizing: border-box;
}

.btn-app-secondary .btn-icon {
    font-size: 20px;
    background: #f4f4f9;
    min-width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-color);
}

/* Modal y Overlays */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 24px;
    padding: 30px 25px;
    box-sizing: border-box;
}