@font-face {
    font-family: 'Rounded Elegance';
    src: url('../../Rounded_Elegance.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body:has(.alma-app-wrap) {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
}
body:has(.alma-app-wrap) header, 
body:has(.alma-app-wrap) footer { display: none !important; }

.alma-app-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
}

.alma-app-wrap * { box-sizing: border-box; }

/* Contenedor principal */
.alma-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 650px;
    padding: 30px !important;
    margin: 0 auto;
}

.alma-container.liquid-glass {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 24px !important;
    box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.alma-container.login-mode {
    max-width: 450px;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* TOP BAR LOGOUT */
.alma-top-bar {
    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 10;
}
.alma-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #F49C93;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 14px;
    background: rgba(244, 156, 147, 0.1);
    border-radius: 99px;
    transition: all 0.2s ease;
}
.alma-logout-btn:hover {
    background: #F49C93;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(244, 156, 147, 0.3);
}


/* UI General */
.alma-header { text-align: center; margin-bottom: 30px; }
.alma-header img { max-width: 150px; height: auto; }
.alma-nav-wrapper { display: flex; justify-content: center; margin-bottom: 20px; }
.alma-segmented-control { display: inline-flex !important; background: rgba(118, 118, 128, 0.12) !important; padding: 4px !important; border-radius: 99px !important; border: none !important; }
.alma-segment { background: transparent !important; border: none !important; padding: 8px 20px !important; font-size: 14px !important; font-weight: 500 !important; color: #1d1d1f !important; cursor: pointer !important; border-radius: 99px !important; transition: all 0.2s ease !important; outline: none !important; text-decoration: none !important;}
.alma-segment.active { background: #ffffff !important; box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 3px 1px rgba(0,0,0,0.04) !important; }
.alma-tab-content { display: none !important; }
.alma-tab-content.active { display: block !important; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Formularios app interior */
.alma-app-wrap h2 { font-size: 22px !important; font-weight: 600 !important; letter-spacing: -0.02em !important; color: #1d1d1f !important; margin-top: 0 !important; margin-bottom: 15px !important; }
.alma-app-wrap h3 { font-size: 16px !important; font-weight: 600 !important; color: #1d1d1f !important; margin: 20px 0 10px 0 !important; }
.alma-form-group { margin-bottom: 15px !important; text-align: left; }
.alma-form-group label { display: block !important; font-size: 12px !important; font-weight: 500 !important; color: #86868b !important; margin-bottom: 5px !important; margin-left: 4px !important; }
.alma-form-group input { width: 100% !important; padding: 12px 14px !important; border-radius: 10px !important; border: 1px solid transparent !important; background: rgba(118, 118, 128, 0.08) !important; font-family: inherit !important; font-size: 15px !important; color: #1d1d1f !important; transition: all 0.2s ease !important; box-shadow: none !important; }
.alma-form-group input:focus { outline: none !important; background: #ffffff !important; border-color: #73C0A5 !important; box-shadow: 0 0 0 3px rgba(115, 192, 165, 0.2) !important; }
.alma-grid-2 { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }

/* NUEVOS ESTILOS DE LOGIN (Basados en la imagen provista) */
.alma-login-container { width: 100%; margin: 0 auto; }
.alma-login-box {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 20px;
    padding: 35px 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    text-align: left;
}
.alma-login-title {
    text-align: center;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin-bottom: 25px !important;
    margin-top: 0 !important;
}
.alma-login-group { margin-bottom: 20px; }
.alma-login-group label {
    display: block; font-size: 13px; color: #333; margin-bottom: 8px; font-weight: 500;
}
.alma-login-group input[type="text"],
.alma-login-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #f2d4d4;
    background-color: #fce8e8 !important; /* Fondo rosado sutil */
    border-radius: 6px !important;
    font-size: 15px;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.alma-login-group input:focus { border-color: #F49C93; }

.password-wrapper { position: relative; }
.toggle-password {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    cursor: pointer; color: #F49C93; display: flex; align-items: center;
}

.alma-login-options { margin-bottom: 25px; display: flex; align-items: center; }
.alma-checkbox { display: flex; align-items: center; cursor: pointer; font-size: 13px; color: #333; }
.alma-checkbox input { margin-right: 8px; accent-color: #F49C93; width: 16px; height: 16px; cursor: pointer; }

.alma-login-btn {
    width: 100%; padding: 14px; background: #F49C93; color: white; border: none;
    border-radius: 6px; font-size: 16px; font-weight: 600; cursor: pointer;
    transition: background 0.2s; font-family: inherit;
}
.alma-login-btn:hover { background: #e08b81; }

/* Botones Interiores */
.alma-btn { display: inline-block !important; padding: 12px 20px !important; border-radius: 10px !important; font-size: 15px !important; font-weight: 600 !important; font-family: inherit !important; cursor: pointer !important; border: none !important; transition: transform 0.1s ease, background 0.2s !important; text-align: center !important; text-decoration: none !important; width: 100%; }
.alma-btn:active { transform: scale(0.97) !important; }
.alma-btn.primary { background: #F49C93 !important; color: white !important; }
.alma-btn.primary:hover { background: #e08b81 !important; }
.alma-btn.secondary { background: rgba(115, 192, 165, 0.15) !important; color: #5a9e86 !important; }
.alma-btn.small { padding: 6px 12px !important; font-size: 12px !important; width: auto; border-radius: 6px !important; background: #73C0A5 !important; color: white !important; }


/* --- VISTA PREVIA WYSIWYG EXACTA --- */
.alma-preview-scale-wrapper {
    width: 100%;
    aspect-ratio: 960 / 680;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.alma-certificate-canvas {
    width: 960px;
    height: 680px;
    position: absolute;
    top: 0; 
    left: 0;
    transform-origin: top left;
    background-color: transparent;
}

.cert-bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    z-index: 1;
    object-fit: contain;
}

.cert-field {
    position: absolute;
    left: 485px; 
    z-index: 2;
    font-family: 'Rounded Elegance', sans-serif !important;
}

.cert-label { color: #73C0A5; font-size: 26px; margin-bottom: 8px; text-align: left; }
.cert-pill {
    background: #ffffff; border-radius: 40px; width: 390px; height: 52px;
    display: flex; align-items: center; padding: 0 20px; color: #888888; font-size: 24px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.04); transition: all 0.2s ease-out;
}
.cert-pill.pulse-active { box-shadow: 0 4px 15px rgba(115, 192, 165, 0.4); transform: scale(1.02); border: 1px solid rgba(115, 192, 165, 0.3); }

.field-fecha { display: flex; align-items: center; }
.field-fecha .cert-label { margin-bottom: 0; margin-right: 15px; }
.field-fecha .cert-pill { width: 230px; justify-content: center; padding: 0; }
.field-fecha .cert-pill span { text-align: center; width: 100%; }
.cert-id { position: absolute; bottom: 30px; right: 50px; z-index: 2; color: #73C0A5; font-size: 18px; font-family: 'Rounded Elegance', sans-serif !important; }

/* Modales y Tablas */
.alma-table-wrapper { overflow-x: auto; }
.alma-table { width: 100%; border-collapse: collapse; }
.alma-table th { background: rgba(0,0,0,0.03); padding: 10px; font-size: 11px; text-transform: uppercase; color: #86868b; text-align: left; }
.alma-table td { padding: 12px; font-size: 14px; color: #1d1d1f; border-bottom: 1px solid rgba(0,0,0,0.05); }

.alma-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.alma-modal-content { background: #ffffff; max-width: 500px; width: 100%; padding: 30px; text-align: center; border-radius: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.alma-modal-image-wrapper { margin: 15px 0; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.1); line-height: 0; }
.alma-modal-image-wrapper img { width: 100%; height: auto; }
.alma-modal-actions { display: flex; gap: 10px; margin-top: 20px; }
