/* =====================================================
   Modales de autenticación (Login / Registro)
   Archivo: css/CanariasTicket/ModalLogin.css
   ===================================================== */

/* --- Tamaño de los diálogos --- */
#ct-modal-login .modal-dialog    { max-width: 420px; }
#ct-modal-registro .modal-dialog { max-width: 640px; }

/* --- Contenido del modal --- */
.ct-auth-modal .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

/* --- Cabecera --- */
.ct-auth-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px 0;
    border-bottom: none;
}

.ct-auth-modal__logo {
    height: 34px;
    width: auto;
}

.ct-auth-modal__header .btn-close {
    opacity: 0.5;
    transition: opacity 0.15s;
}

.ct-auth-modal__header .btn-close:hover { opacity: 1; }

/* --- Cuerpo --- */
.ct-auth-modal__body {
    padding: 20px 28px 28px;
}

.ct-auth-modal__body h4 {
    font-family: "Nunito", sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--header, #151415);
    margin: 0 0 4px;
}

.ct-auth-modal__subtitle {
    font-family: "Nunito", sans-serif;
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px;
}

/* --- Campos del formulario --- */
.ct-auth-field {
    margin-bottom: 14px;
}

.ct-auth-field .form-control,
.ct-auth-field select.form-control {
    font-family: "Nunito", sans-serif;
    font-size: 14px;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    padding: 10px 14px;
    height: auto;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ct-auth-field .form-control:focus,
.ct-auth-field select.form-control:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 3px rgba(151, 191, 31, 0.18);
    outline: none;
}

.ct-auth-field .text-danger {
    font-family: "Nunito", sans-serif;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* --- Error general --- */
.ct-auth-error {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: "Nunito", sans-serif;
    font-size: 13px;
    color: #dc2626;
    margin-bottom: 14px;
}

/* --- Botón de submit --- */
.ct-auth-submit {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
    padding-top: 11px;
    padding-bottom: 11px;
    font-size: 15px;
}

/* --- Pie del modal de login (enlace a registro) --- */
.ct-auth-footer {
    text-align: center;
    margin-top: 16px;
    font-family: "Nunito", sans-serif;
    font-size: 13.5px;
    color: #6b7280;
}

.ct-auth-footer a {
    color: var(--theme-color);
    font-weight: 700;
    text-decoration: none;
}

.ct-auth-footer a:hover { text-decoration: underline; }

/* --- Grid para el formulario de registro --- */
.ct-auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ct-auth-grid .ct-auth-field        { margin-bottom: 0; }
.ct-auth-grid .ct-auth-field-full   { grid-column: 1 / -1; }

/* --- Loading spinner (mientras carga el formulario de registro) --- */
.ct-auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 0;
    font-family: "Nunito", sans-serif;
    font-size: 14px;
    color: #6b7280;
}

.ct-auth-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2.5px solid #e5e7eb;
    border-top-color: var(--theme-color);
    border-radius: 50%;
    animation: ct-auth-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* --- Acciones del registro (botón + enlace "ya tengo cuenta") --- */
.ct-auth-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.ct-auth-actions .ct-auth-submit {
    width: auto;
    flex: 1 1 auto;
}

.ct-auth-link-login {
    font-family: "Nunito", sans-serif;
    font-size: 13.5px;
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
}

.ct-auth-link-login:hover {
    color: var(--theme-color);
    text-decoration: underline;
}

/* --- Acceso de administración — enlace discreto en el footer del modal de cliente --- */
.ct-auth-footer--admin-link {
    margin-top: 10px;
    text-align: center;
}

.ct-auth-admin-link {
    font-size: 11px;
    color: #b0bec5;
    text-decoration: none;
    letter-spacing: .02em;
}

.ct-auth-admin-link:hover {
    color: #546e7a;
    text-decoration: none;
}

/* Modal de admin — mismo ancho que el de login de cliente */
#ct-modal-admin-login .modal-dialog {
    max-width: 420px;
}

/* Enlace admin en el footer del site */
.ct-footer-admin-access {
    text-align: center;
    margin-top: 14px;
    padding-bottom: 4px;
}

.ct-footer-admin-access a {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.18);
    text-decoration: none;
    letter-spacing: .04em;
}

.ct-footer-admin-access a:hover {
    color: rgba(255, 255, 255, 0.45);
}

/* --- Responsive --- */
@media (max-width: 575px) {
    #ct-modal-registro .modal-dialog      { margin: 0.5rem; }
    #ct-modal-login .modal-dialog         { margin: 0.5rem; }
    #ct-modal-admin-login .modal-dialog   { margin: 0.5rem; }
    .ct-auth-grid { grid-template-columns: 1fr; }
    .ct-auth-grid .ct-auth-field-full { grid-column: 1; }
    .ct-auth-modal__body { padding: 16px 18px 22px; }
}
