/* Customização de mensagens de erro do CakePHP */
.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
    color: #721c24;
    padding: 10px 15px;
    margin-top: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

.error-message ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.error-message li {
    padding: 3px 0;
    line-height: 1.5;
}

.error-message li:before {
    content: "⚠ ";
    color: #dc3545;
    font-weight: bold;
    margin-right: 5px;
}

/* Quando houver apenas um erro, remover o espaçamento extra */
.error-message ul li:only-child {
    padding: 0;
}

/* Animação suave ao aparecer */
.error-message {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .error-message {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Modal de login (site público) — alinhado ao tema kappke-layout */
.login-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s;
}

.login-modal.open {
    visibility: visible;
    opacity: 1;
}

.login-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 38, 46, 0.65);
    cursor: pointer;
}

.login-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--card, #fff);
    border-radius: var(--radius, 0.5rem);
    box-shadow: var(--shadow-xl, 0 20px 60px rgba(0, 0, 0, 0.15));
    padding: 2rem 1.75rem;
    max-height: 90vh;
    overflow-y: auto;
}

.login-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius, 0.5rem);
    font-size: 1.5rem;
    line-height: 1;
    color: var(--muted-foreground, #666);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-modal-close:hover {
    background: var(--muted, #f5f5f5);
    color: var(--primary, #003842);
}

.login-modal-dialog h2 {
    font-family: var(--font-heading, 'New Amsterdam', sans-serif);
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.login-modal-sub {
    color: var(--muted-foreground);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.login-modal-dialog .form-group {
    margin-bottom: 1rem;
}

.login-modal-dialog .form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--foreground);
}

.login-modal-dialog input[type="email"],
.login-modal-dialog input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--input, #e2e8f0);
    border-radius: var(--radius, 0.5rem);
    font-family: var(--font-body, Roboto, sans-serif);
    font-size: 1rem;
}

.login-modal-dialog input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 56, 66, 0.15);
}

.login-modal-dialog .message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius, 0.5rem);
    font-size: 0.9rem;
}

.login-modal-dialog .message.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.login-modal-dialog .btn-login-submit {
    width: 100%;
    margin-top: 0.5rem;
}

/* Flash no modal de login — alerta Cake (error.ctp: alert-danger + alert-icon-bg) */
.login-modal-flash {
    margin-bottom: 1rem;
}

.login-modal-flash .alert.alert-danger.alert-icon-bg {
    display: flex;
    align-items: stretch;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 1px solid #fecaca;
    border-radius: var(--radius, 0.5rem);
    overflow: hidden;
    background: #fff7f7;
    color: #7f1d1d;
    font-family: var(--font-body, Roboto, sans-serif);
    font-size: 0.9rem;
    line-height: 1.45;
    box-shadow: 0 1px 3px rgba(185, 28, 28, 0.12);
    animation: loginModalFlashIn 0.35s ease-out;
}

@keyframes loginModalFlashIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Coluna do ícone: zmdi oculto (fonte não carrega no site público); SVG em ::before */
.login-modal-flash .alert-danger .alert-icon {
    position: relative;
    flex: 0 0 3.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #fecaca 0%, #fca5a5 100%);
    color: #991b1b;
}

.login-modal-flash .alert-danger .alert-icon i {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.login-modal-flash .alert-danger .alert-icon::before {
    content: "";
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    background: center / contain no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23991b1b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E");
}

.login-modal-flash .alert-danger .alert-message {
    flex: 1;
    position: relative;
    padding: 0.85rem 2.5rem 0.85rem 0.9rem;
    min-width: 0;
}

.login-modal-flash .alert-danger .alert-message .close {
    position: absolute;
    top: 0.4rem;
    right: 0.35rem;
    padding: 0.35rem 0.5rem;
    margin: 0;
    line-height: 1;
    font-size: 1.1rem;
    font-weight: 400;
    color: #7f1d1d;
    background: transparent;
    border: none;
    border-radius: var(--radius, 0.35rem);
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.login-modal-flash .alert-danger .alert-message .close:hover,
.login-modal-flash .alert-danger .alert-message .close:focus {
    opacity: 1;
    background: rgba(185, 28, 28, 0.08);
    outline: none;
}

.login-modal-flash .alert-danger .alert-message .close span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-modal-flash .alert-danger .alert-message .close i {
    display: none;
}

.login-modal-flash .alert-danger .alert-message .close span::after {
    content: "\00d7";
    font-size: 1.2rem;
    line-height: 1;
    color: inherit;
}

@media (max-width: 380px) {
    .login-modal-flash .alert-danger .alert-icon {
        flex-basis: 2.75rem;
    }

    .login-modal-flash .alert-danger .alert-message {
        padding-right: 2.25rem;
        font-size: 0.85rem;
    }
}

